chiark / gitweb /
Revert "simplex wip: compiles"
[moebius3.git] / findcurve.c
index a8dfc469f331d52339a6171b8c054cc95697cff4..055018f3bfb6abf87e5dba0aabbcf8dcb59dc906 100644 (file)
@@ -42,24 +42,27 @@ static void prepare(double X[] /* startpoint */) {
   PREPARE;
 }
 
+//#define DEBUG
+
 static double cb_Efunc(void *xp) {
   const double *X = xp;
+  int P;
   DECLARE_F_G;
   CALCULATE_F_G;
 
-  printf(" Efunc ");
-  printcore(X);
-
-  double e = 0;
-  int P;
-  for (P=0; P<NP-3; P++) {
-    double P_cost;
-    CALCULATE_COST;
-    printf(" %.18g", P_cost);
-    e += P_cost;
+#ifdef DEBUG
+  int i,j;
+  printf(" Efunc\n");
+  for (j=0; j<3; j++) {
+    for (P=0; P<NP; P++)
+      printf(" %7.4f", POINT(P)[j]);
+    printf("\n");
   }
-  printf("\n");
-  return e;
+  printf("             ");
+#endif
+
+  CALCULATE_COST;
+  return cost;
 }
 
 static void cb_step(const gsl_rng *rng, void *xp, double step_size) {