Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
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
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;
}