From a21ca8a1edca8cffdb3b36922ee156a2d93425bc Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 20 Jan 2012 23:03:00 -0800 Subject: Fix iteration bug in fine vector search --- libcrystfel/src/reax.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'libcrystfel/src/reax.c') diff --git a/libcrystfel/src/reax.c b/libcrystfel/src/reax.c index 17fa69f3..c02cac06 100644 --- a/libcrystfel/src/reax.c +++ b/libcrystfel/src/reax.c @@ -369,11 +369,17 @@ static void fine_search(struct reax_private *p, ImageFeatureList *flist, struct dvec dir; int i, s; double max; + double th_min, th_max; + double ph_min, ph_max; inc = p->angular_inc / 100.0; - for ( th=c->v.th-p->angular_inc; th<=c->v.th+p->angular_inc; th+=inc ) { - for ( ph=c->v.ph-p->angular_inc; ph<=c->v.ph+p->angular_inc; ph+=inc ) { + th_min = c->v.th - p->angular_inc; + th_max = c->v.th + p->angular_inc; + ph_min = c->v.ph - p->angular_inc; + ph_max = c->v.ph + p->angular_inc; + for ( th=th_min; th<=th_max; th+=inc ) { + for ( ph=ph_min; ph<=ph_max; ph+=inc ) { double new_fom; -- cgit v1.2.3