|
From: <kin...@us...> - 2024-07-09 22:18:52
|
Revision: 7191
http://sourceforge.net/p/teem/code/7191
Author: kindlmann
Date: 2024-07-09 22:18:49 +0000 (Tue, 09 Jul 2024)
Log Message:
-----------
multi-fit may be working now
Modified Paths:
--------------
teem/trunk/src/limn/lpu_cbfit.c
teem/trunk/src/limn/splineFit.c
Modified: teem/trunk/src/limn/lpu_cbfit.c
===================================================================
--- teem/trunk/src/limn/lpu_cbfit.c 2024-07-09 21:34:52 UTC (rev 7190)
+++ teem/trunk/src/limn/lpu_cbfit.c 2024-07-09 22:18:49 UTC (rev 7191)
@@ -219,7 +219,7 @@
unsigned int ci, si;
limnCbfPath *spath = limnCbfPathNew(size1);
airMopAdd(mop, spath, (airMopper)limnCbfPathNix, airMopAlways);
- printf("%s: synthetically sampling %u splines with %u points", me, size1,
+ printf("%s: synthetically sampling %u splines with %u points\n", me, size1,
synthNum);
/* copy in control point data */
for (si = 0; si < size1; si++) {
@@ -354,14 +354,16 @@
const double *VTTV[4];
getLoHi(&loi, &hii, lpnt, fitMultiLoHi[0], fitMultiLoHi[1]);
getVTTV(VTTV, lpnt, fitTT, loi, hii);
- if (limnCbfMulti(path, VTTV[0], VTTV[1], VTTV[2], VTTV[3], fctx, lpnt, loi, hii)) {
+ if (limnCbfCtxPrep(fctx, lpnt)
+ || limnCbfMulti(path, VTTV[0], VTTV[1], VTTV[2], VTTV[3], fctx, lpnt, loi,
+ hii)) {
airMopAdd(mop, err = biffGetDone(LIMN), airFree, airMopAlways);
fprintf(stderr, "%s: trouble doing multi fit:\n%s", me, err);
airMopError(mop);
return 1;
}
- printf("%s: limnCbfMulti results: %u segments %s\n", me, path->segNum,
- path->isLoop ? "in loop" : "NOT in loop");
+ printf("%s: limnCbfMulti results: %u segments in %s\n", me, path->segNum,
+ path->isLoop ? "loop" : "NOT-loop");
for (segi = 0; segi < path->segNum; segi++) {
const limnCbfSeg *seg = path->seg + segi;
const double *xy = seg->xy;
Modified: teem/trunk/src/limn/splineFit.c
===================================================================
--- teem/trunk/src/limn/splineFit.c 2024-07-09 21:34:52 UTC (rev 7190)
+++ teem/trunk/src/limn/splineFit.c 2024-07-09 22:18:49 UTC (rev 7191)
@@ -1098,6 +1098,10 @@
points falls below fctx->nrpIota * fctx->epsilon, or,
- parameterization change falls below fctx->nrpDeltaThresh
Information about the results of this process are set in the given fctx.
+
+This assumes that limnCbfCtxPrep(fctx, lpnt) was called without error!
+That (via ctxBuffersSet) allocates fctx->uu that we depend on here
+(and we fail via biff if it seems like that buffer was not set)
*/
static int /* Biff: 1 */
fitSingle(double alpha[2], const double vv0[2], const double tt1[2], const double tt2[2],
@@ -1106,6 +1110,14 @@
static const char me[] = "fitSingle";
uint iter, spanlen = spanLength(lpnt, loi, hii);
+ if (!(alpha && vv0 && tt1 && tt2 && vv3 && fctx && lpnt)) {
+ biffAddf(LIMN, "%s: got NULL pointer", me);
+ return 1;
+ }
+ if (!(fctx->uu)) {
+ biffAddf(LIMN, "%s: fcgtx->uu NULL; was limnCbfCtxPrep called?", me);
+ return 1;
+ }
/* DIM=2 pretty much everywhere here */
if (fctx->verbose) {
printf("%s[%d,%d]: hello, vv0=(%g,%g), tt1=(%g,%g), "
@@ -1180,7 +1192,7 @@
int converged = AIR_FALSE;
for (iter = 0; fctx->distBig && iter < fctx->nrpIterMax; iter++) {
int simple;
- if (fctx->verbose) {
+ if (fctx->verbose > 1) {
printf("%s[%d,%d]: nrp iter %u starting with alpha %g,%g (det %g) (big %d)\n",
me, loi, hii, iter, alpha[0], alpha[1], fctx->alphaDet, fctx->distBig);
}
@@ -1202,7 +1214,7 @@
biffAddf(LIMN, "%s: trouble", me);
return 1;
}
- if (fctx->verbose) {
+ if (fctx->verbose > 1) {
printf("%s[%d,%d]: nrp iter %u (reparm) delta = %g (big %d)\n", me, loi, hii,
iter, delta, fctx->distBig);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|