定义好动态数组,这个用type record比较好。然后传递Record指针。
[ 本帖最后由 volte 于 2014-6-27 11:01 编辑 ]
void evaluation(double *pop, double *fitness, unsigned int M, unsigned int D, unsigned int fun, unsigned int NF) { unsigned int i, j, f; for(i = 0; i < M; i++) for(j = 0, f = fun; j < NF; j++, f++) fitness[(NF * i) + j] = chfun(&pop[D * i], f); }