chiark / gitweb /
curveopt: wip
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 7 Apr 2018 22:41:34 +0000 (23:41 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 7 Apr 2018 22:41:34 +0000 (23:41 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
curveopt.py
findcurve.c

index b0e725c98b89f08f1bf53b759dbfcda302ad9dea..5ebe1661c5f9f35c06dbde6fa5c584a4ce8f9e81 100644 (file)
@@ -24,6 +24,7 @@ class OptimisedCurve():
     db = DiscreteBezier(cp, nt, bezier_constructor=BezierSegment)
 
     fc_input = map(db.point_at_it, range(0, nt+1))
+    dbg(repr(fc_input))
 
     for end in (False,True):
       ei = nt if end else 0
index a8dfc469f331d52339a6171b8c054cc95697cff4..0b13a2137c6c1f2d6c54a14c5b8da25097fca755 100644 (file)
@@ -42,23 +42,37 @@ static void prepare(double X[] /* startpoint */) {
   PREPARE;
 }
 
+#define DEBUG
+
 static double cb_Efunc(void *xp) {
   const double *X = xp;
   DECLARE_F_G;
   CALCULATE_F_G;
 
-  printf(" Efunc ");
-  printcore(X);
+#ifdef DEBUG
+  int i,j;
+  printf(" Efunc\n");
+  for (j=0; j<3; j++) {
+    for (i=0; i<NP; i++)
+      printf(" %7.4f", POINT(i)[j]);
+    printf("\n");
+  }
+  printf("             ");
+#endif
 
   double e = 0;
   int P;
   for (P=0; P<NP-3; P++) {
     double P_cost;
     CALCULATE_COST;
-    printf(" %.18g", P_cost);
+#ifdef DEBUG
+    printf(" %7.4f", P_cost);
+#endif
     e += P_cost;
   }
+#ifdef DEBUG
   printf("\n");
+#endif
   return e;
 }