diff options
author | Thomas White <taw@physics.org> | 2012-01-20 23:03:00 -0800 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2012-02-22 15:27:44 +0100 |
commit | a21ca8a1edca8cffdb3b36922ee156a2d93425bc (patch) | |
tree | bfc2b2b0622d424604f880379c659d27870a8bed /libcrystfel/src/reax.c | |
parent | 0ae59a0d41043da6e1f5a6eecbc6c5cb6cda418a (diff) |
Fix iteration bug in fine vector search
Diffstat (limited to 'libcrystfel/src/reax.c')
-rw-r--r-- | libcrystfel/src/reax.c | 10 |
1 files changed, 8 insertions, 2 deletions
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; |