aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2012-01-21 23:25:02 -0800
committerThomas White <taw@physics.org>2012-02-22 15:27:44 +0100
commit985418be1b50dd66114709fe63933e8b62654966 (patch)
tree684bf4dbfb5aea16dcf525aebd9aea1c2b0c47b8
parente2a46e380cc9642864918bc0dd6e42cadc6c7629 (diff)
Fix broken list addition
-rw-r--r--libcrystfel/src/reax.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/libcrystfel/src/reax.c b/libcrystfel/src/reax.c
index 45ec7f99..4f12075e 100644
--- a/libcrystfel/src/reax.c
+++ b/libcrystfel/src/reax.c
@@ -154,22 +154,21 @@ static void add_candidate(struct reax_search_v *s, struct dvec *dir,
size_t ns;
int i, cpos;
+ cpos = s->n_cand;
for ( i=0; i<s->n_cand; i++ ) {
-
if ( fom > s->cand[i].fom ) {
- cshift = s->cand[i];
- s->cand[i].v.x = dir->x*peak_mod;
- s->cand[i].v.y = dir->y*peak_mod;
- s->cand[i].v.z = dir->z*peak_mod;
- s->cand[i].v.th = dir->th;
- s->cand[i].v.ph = dir->ph;
- s->cand[i].fom = fom;
cpos = i;
break;
}
-
}
+ cshift.v.x = dir->x*peak_mod;
+ cshift.v.y = dir->y*peak_mod;
+ cshift.v.z = dir->z*peak_mod;
+ cshift.v.th = dir->th;
+ cshift.v.ph = dir->ph;
+ cshift.fom = fom;
+
for ( i=cpos; i<s->n_cand; i++ ) {
struct reax_candidate cshift2;