From 8eec96ac916dcc81ac7a161c809e852e6915b32e Mon Sep 17 00:00:00 2001 From: taw27 Date: Fri, 29 Aug 2008 11:22:45 +0000 Subject: Remove this "DoesNothing" stuff - DIRECTIONS do nothing, not simplex vertices git-svn-id: svn://cook.msm.cam.ac.uk:745/diff-tomo/dtr@292 bf6ca9ba-c028-0410-8290-897cf20841d1 --- src/refine.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/refine.c b/src/refine.c index 5e9a5eb..431d526 100644 --- a/src/refine.c +++ b/src/refine.c @@ -43,7 +43,6 @@ typedef struct { double dax; double dbx; double dcx; double day; double dby; double dcy; double daz; double dbz; double dcz; - int does_nothing; /* If non-zero, this vertex doesn't appear to affect the FoM */ } SimplexVertex; typedef struct { @@ -163,7 +162,6 @@ static void refine_simplex_transform(SimplexVertex *s, int v_worst, double fac) centre.dax = 0.0; centre.day = 0.0; centre.daz = 0.0; centre.dbx = 0.0; centre.dby = 0.0; centre.dbz = 0.0; centre.dcx = 0.0; centre.dcy = 0.0; centre.dcz = 0.0; - centre.does_nothing = 0; nv = 0; for ( i=0; i<=NUM_PARAMS; i++ ) { if ( i != v_worst ) { @@ -228,15 +226,15 @@ static double refine_iteration(SimplexVertex *s, Deviation *d, int nf) { fom_best = 100e9; v_second_worst = 0; fom_second_worst = 0.0; - if ( REFINE_DEBUG ) printf("Vertex FoM/nm^-1 DoesNothing\n"); + if ( REFINE_DEBUG ) printf("Vertex FoM/nm^-1\n"); for ( i=0; i<=NUM_PARAMS; i++ ) { double fom; fom = refine_mean_dev(d, nf, s, i); - if ( REFINE_DEBUG ) printf("%6i %8f %s\n", i, fom/DISPFACTOR, s[i].does_nothing?"*":" "); - if ( (s[i].does_nothing == 0) && (fom > fom_worst) ) { + if ( REFINE_DEBUG ) printf("%6i %8f\n", i, fom/DISPFACTOR); + if ( fom > fom_worst ) { v_second_worst = v_worst; fom_second_worst = fom_worst; fom_worst = fom; @@ -304,7 +302,6 @@ static double refine_iteration(SimplexVertex *s, Deviation *d, int nf) { } else { printf("No change!\n"); - s[v_worst].does_nothing = 1; } @@ -314,7 +311,7 @@ static double refine_iteration(SimplexVertex *s, Deviation *d, int nf) { for ( i=0; i<=NUM_PARAMS; i++ ) { double fom; fom = refine_mean_dev(d, nf, s, i); - if ( (s[i].does_nothing == 0) && (fom > fom_worst) ) { + if ( fom > fom_worst ) { fom_worst = fom; } if ( fom < fom_best ) { @@ -394,8 +391,8 @@ double refine_do_cell(ControlContext *ctx) { /* Determine the difference vector */ dix = rf->partner->x - rf->x; diy = rf->partner->y - rf->y; - //printf("RF: Feature %3i: %3i %3i %3i dev = %+9.5f %+9.5f px ", j, d[f].h, d[f].k, d[f].l, - // dix, diy); + printf("RF: Feature %3i: %3i %3i %3i dev = %+9.5f %+9.5f px ", j, d[f].h, d[f].k, d[f].l, + dix, diy); old_x = rf->partner->x; old_y = rf->partner->y; @@ -405,7 +402,7 @@ double refine_do_cell(ControlContext *ctx) { mapping_rotate(dx, dy, 0.0, &dlx, &dly, &dlz, image->omega, image->tilt); rf->partner->x = old_x; rf->partner->y = old_y; - //printf("=> %+10.5f %+10.5f %+10.5f nm^-1\n", dlx/DISPFACTOR, dly/DISPFACTOR, dlz/DISPFACTOR); + printf("=> %+10.5f %+10.5f %+10.5f nm^-1\n", dlx/DISPFACTOR, dly/DISPFACTOR, dlz/DISPFACTOR); d[f].dx = dlx; d[f].dy = dly; @@ -423,7 +420,6 @@ double refine_do_cell(ControlContext *ctx) { s[0].dax = 0.0; s[0].dbx = 0.0; s[0].dcx = 0.0; s[0].day = 0.0; s[0].dby = 0.0; s[0].dcy = 0.0; s[0].daz = 0.0; s[0].dbz = 0.0; s[0].dcz = 0.0; - s[0].does_nothing = 0; memcpy(&s[1], &s[0], sizeof(SimplexVertex)); s[1].dax = delta; memcpy(&s[2], &s[0], sizeof(SimplexVertex)); s[2].day = delta; memcpy(&s[3], &s[0], sizeof(SimplexVertex)); s[3].dbx = delta; -- cgit v1.2.3