|
From: <le...@pr...> - 2004-11-07 00:47:01
|
Update of /cvsroot/meshdb/src/geo/shift In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2699/geo/shift Modified Files: Tag: leonard-dev main.c Log Message: possible fix to convergence bug Index: main.c =================================================================== RCS file: /cvsroot/meshdb/src/geo/shift/main.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -d -r1.2 -r1.2.2.1 --- main.c 24 Nov 2003 07:04:51 -0000 1.2 +++ main.c 7 Nov 2004 00:46:51 -0000 1.2.2.1 @@ -112,11 +112,19 @@ result.lon_shift = 0; break; } - if (abs(lat+result.lat_shift-olat)<result.lat_shift_acc - && abs(lon+result.lon_shift-olon)<result.lon_shift_acc) + if (abs(lat+result.lat_shift-olat)<abs(result.lat_shift_acc) + && abs(lon+result.lon_shift-olon)<abs(result.lon_shift_acc)) break; + + if (verbose) { + fprintf(stderr, "converged one step:\n"); + fprintf(stderr, " lat: old=%f shift=%f acc=%f -> %f\n", lat, result.lat_shift, result.lat_shift_acc, olat - result.lat_shift); + fprintf(stderr, " lon: old=%f shift=%f acc=%f -> %f\n", lon, result.lon_shift, result.lon_shift_acc, olon - result.lon_shift); + } + lat = olat - result.lat_shift; lon = olon - result.lon_shift; + } if (i == 5) errx(1, "reverse algorithm didn't converge"); |