From: Gordon K. <kin...@us...> - 2006-10-25 12:19:26
|
Update of /cvsroot/teem/teem/src/push/test In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv10340/test Modified Files: eparse.c Log Message: massively reworked: 1) tractlets gone, 2) asynchronous (Gauss-Seidel) updates, 3) potential energy gradient descent. Also two optimizations: only periodically gageProbe() field to get new values, and only periodically update list of active neighbors Index: eparse.c =================================================================== RCS file: /cvsroot/teem/teem/src/push/test/eparse.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** eparse.c 22 Oct 2006 12:22:58 -0000 1.1 --- eparse.c 25 Oct 2006 12:19:20 -0000 1.2 *************** *** 28,37 **** int main(int argc, char *argv[]) { ! char *me, *err; hestOpt *hopt=NULL; airArray *mop; pushEnergySpec *ensp; ! unsigned int pi; mop = airMopNew(); --- 28,38 ---- int main(int argc, char *argv[]) { ! char *me; hestOpt *hopt=NULL; airArray *mop; pushEnergySpec *ensp; ! unsigned int pi, xi, nn; ! double xx, supp, del; mop = airMopNew(); *************** *** 45,52 **** airMopAdd(mop, hopt, (airMopper)hestParseFree, airMopAlways); ! printf("%s: parsed energy \"%s\", with %u parms.\n", me, ! ensp->energy->name, ensp->energy->parmNum); for (pi=0; pi<ensp->energy->parmNum; pi++) { ! printf("%u: %g\n", pi, ensp->parm[pi]); } --- 46,68 ---- airMopAdd(mop, hopt, (airMopper)hestParseFree, airMopAlways); ! fprintf(stderr, "%s: parsed energy \"%s\", with %u parms.\n", me, ! ensp->energy->name, ensp->energy->parmNum); for (pi=0; pi<ensp->energy->parmNum; pi++) { ! fprintf(stderr, "%u: %g\n", pi, ensp->parm[pi]); ! } ! fprintf(stderr, "\n"); ! ! nn = 600; ! supp = ensp->energy->support(ensp->parm); ! del = AIR_DELTA(0, 2, nn, 0, supp); ! for (xi=1; xi<nn; xi++) { ! double x0, x1, ee, ff, e0, e1, dummy; ! xx = AIR_AFFINE(0, xi, nn, 0, supp); ! x1 = AIR_AFFINE(0, xi+1, nn, 0, supp); ! x0 = AIR_AFFINE(0, xi-1, nn, 0, supp); ! ensp->energy->eval(&e1, &dummy, x1, ensp->parm); ! ensp->energy->eval(&e0, &dummy, x0, ensp->parm); ! ensp->energy->eval(&ee, &ff, xx, ensp->parm); ! printf("%g %g %g %g\n", xx, ee, ff, (e1 - e0)/del); } |