⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 print_format.c

📁 很好的一个约束遗传算法优化程序
💻 C
📖 第 1 页 / 共 2 页
字号:
/*                                                                              *//*           FUNCTION NAME     :   print_matrix()                               *//*                                                                              *//*           SYNOPSIS          :   void print_matrix(lr,ur,lc,uc,mat)           *//*                                                                              *//*           DESCRIPTION       :   This function prints a given float matrix,   *//*                                  on to the standard output                   *//*                                                                              *//*           FUNCTIONS CALLED  :   None                                         *//*                                                                              *//*           CALLING FUNCITONS :   main(),                                      *//*                                 optimization().                              *//*                                                                              *//*           AUTHOR            :   Swarnalatha Swaminathan                      *//*                                                                              *//*           DATE              :   1/17/92                                      *//*                                                                              *//*                                                                              *//*           REV            DATE            BY           DESCRIPTION            *//*           ---            ----            --           -----------            *//*                                                                              *//*                                                                              *//********************************************************************************/void print_matrix(lr, ur, lc, uc, mat)    int             lr, ur, lc, uc;    MATRIX          mat;{    int             i, j;    for (i = lr; i <= ur; i++)    {	fprintf(output, "\n");	for (j = lc; j <= uc; j++)	    fprintf(output, "%5.2f\t", mat[i][j]);    }    fprintf(output, "\n\n");}/********************************************************************************//*                                                                              *//*           FUNCTION NAME     :   print_population()                           *//*                                                                              *//*           SYNOPSIS          :   void print_population(lr,ur,lc,uc,mat)       *//*                                                                              *//*           DESCRIPTION       :   This function prints the initial and final   *//*                                  population on to the standard output.       *//*                                                                              *//*           FUNCTIONS CALLED  :   None                                         *//*                                                                              *//*           CALLING FUNCITONS :   optimization()                               *//*                                                                              *//*           AUTHOR            :   Swarnalatha Swaminathan                      *//*                                                                              *//*           DATE              :   1/17/92                                      *//*                                                                              *//*                                                                              *//*           REV            DATE            BY           DESCRIPTION            *//*           ---            ----            --           -----------            *//*            A             9/15/92      Tom Logan                              *//*                                                                              *//*                                                                              *//********************************************************************************/void print_population(out, r, c, mat)    FILE           *out;    int             r, c;    MATRIX          mat;{    int             i, j;    for (i = 1; i <= r; i++)    {	fprintf(out, "%20.8f", mat[i][0]);	for (j = 1; j <= c - 1; j++)	{	    if (((j - 1) % 3 == 0) && (j != 1))		fprintf(out, "\n                    ");	    fprintf(out, "%20.8f", mat[i][j]);	}	fprintf(out, "\n");    }}/********************************************************************************//*                                                                              *//*           FUNCTION NAME     :   print_vector()                               *//*                                                                              *//*           SYNOPSIS          :   void print_vector(arr,l,u)                   *//*                                                                              *//*           DESCRIPTION       :   This function prints a given float vector,   *//*                                  on to the standard output                   *//*                                                                              *//*           FUNCTIONS CALLED  :   None                                         *//*                                                                              *//*           CALLING FUNCITONS :   main()                                       *//*                                                                              *//*           AUTHOR            :   Swarnalatha Swaminathan                      *//*                                                                              *//*           DATE              :   1/17/92                                      *//*                                                                              *//*                                                                              *//*           REV            DATE            BY           DESCRIPTION            *//*           ---            ----            --           -----------            *//*                                                                              *//*                                                                              *//********************************************************************************/void print_vector(arr, l, u)    VECTOR          arr;    int             l, u;{    int             i;    for (i = l; i <= u; i++)	fprintf(output, "%18.8f\t", arr[i]);/*    for (i = l; i <= u; i++)	printf("%18.8f\t", arr[i]);*/}/********************************************************************************//*                                                                              *//*           FUNCTION NAME     :   print_ivector()                              *//*                                                                              *//*           SYNOPSIS          :   void print_ivector(arr,l,u)                  *//*                                                                              *//*           DESCRIPTION       :   This function prints a given integer vector, *//*                                  on to the standard output                   *//*                                                                              *//*           FUNCTIONS CALLED  :   None                                         *//*                                                                              *//*           CALLING FUNCITONS :   p_equalities()                               *//*                                                                              *//*           AUTHOR            :   Swarnalatha Swaminathan                      *//*                                                                              *//*           DATE              :   1/17/92                                      *//*                                                                              *//*                                                                              *//*           REV            DATE            BY           DESCRIPTION            *//*           ---            ----            --           -----------            *//*                                                                              *//*                                                                              *//********************************************************************************/void print_ivector(arr, l, u)    int             l, u;    IVECTOR         arr;{    int             i;    for (i = l; i <= u; i++)	fprintf(output, "%18.8d\t", arr[i]);    fprintf(output, "\n\n");}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -