static double cb_Efunc(void *xp) {
const double *X = xp;
+ int P;
DECLARE_F_G;
CALCULATE_F_G;
int i,j;
printf(" Efunc\n");
for (j=0; j<3; j++) {
- for (i=0; i<NP; i++)
- printf(" %7.4f", POINT(i)[j]);
+ for (P=0; P<NP; P++)
+ printf(" %7.4f", POINT(P)[j]);
printf("\n");
}
printf(" ");
#endif
- double e = 0;
- int P;
- for (P=0; P<NP-3; P++) {
- double P_cost;
- CALCULATE_COST;
-#ifdef DEBUG
- printf(" %7.4f", P_cost);
-#endif
- e += P_cost;
- }
-#ifdef DEBUG
- printf("\n");
-#endif
- return e;
+ CALCULATE_COST;
+ return cost;
}
static void cb_step(const gsl_rng *rng, void *xp, double step_size) {