aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortaw27 <taw27@bf6ca9ba-c028-0410-8290-897cf20841d1>2008-08-19 12:47:07 +0000
committertaw27 <taw27@bf6ca9ba-c028-0410-8290-897cf20841d1>2008-08-19 12:47:07 +0000
commit1ffcf082a9b8020c019748b1aa6059c70a956f88 (patch)
tree3c627afe43f78e57502be20ce82d83a3e2eca624
parent95c1571a1e624def99baf0fc16d7b740345ad6b6 (diff)
Enable debugging, relax tolerance and monitor simplex size
git-svn-id: svn://cook.msm.cam.ac.uk:745/diff-tomo/dtr@291 bf6ca9ba-c028-0410-8290-897cf20841d1
-rw-r--r--src/refine.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/refine.c b/src/refine.c
index 5de8df3..5e9a5eb 100644
--- a/src/refine.c
+++ b/src/refine.c
@@ -36,7 +36,7 @@
#define NUM_PARAMS 9
/* Refine debug */
-#define REFINE_DEBUG 0
+#define REFINE_DEBUG 1
/* A simplex is an array of ten of these */
typedef struct {
@@ -309,7 +309,7 @@ static double refine_iteration(SimplexVertex *s, Deviation *d, int nf) {
}
/* Check convergence and return */
- fom_worst = 0;
+ fom_worst = 0.0;
fom_best = 100e9;
for ( i=0; i<=NUM_PARAMS; i++ ) {
double fom;
@@ -321,7 +321,10 @@ static double refine_iteration(SimplexVertex *s, Deviation *d, int nf) {
fom_best = fom;
}
}
- return fom_worst - fom_best;
+
+ printf("Simplex size: %e - %e = %e\n", fom_worst/DISPFACTOR, fom_best/DISPFACTOR, (fom_worst - fom_best)/DISPFACTOR);
+
+ return fom_best;
}
@@ -331,7 +334,7 @@ double refine_do_cell(ControlContext *ctx) {
Deviation *d;
double delta;
int i, nf, f, it, maxiter;
- const double tol = 0.00001e9; /* Stopping condition */
+ const double tol = 0.001e9; /* Stopping condition */
//const double tol = 0.001; /* For testing */
if ( !ctx->cell_lattice ) {
@@ -432,7 +435,7 @@ double refine_do_cell(ControlContext *ctx) {
memcpy(&s[9], &s[0], sizeof(SimplexVertex)); s[9].dcz = delta;
/* Iterate */
- maxiter = 500;
+ maxiter = 10000;
for ( it=0; it<maxiter; it++ ) {
double conv;