diff options
author | Thomas White <taw@physics.org> | 2014-03-04 15:25:59 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2014-03-04 15:25:59 +0100 |
commit | 3bcd0cb4cb5b328d54b4e8342215f47168216ace (patch) | |
tree | b4c38b34db325e1f57fac03ce0eecca07fb2c911 /src/ambigator.c | |
parent | fb1832f80cebe48f8bf066f37973058b7ce3e334 (diff) |
Fussiness
Diffstat (limited to 'src/ambigator.c')
-rw-r--r-- | src/ambigator.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/ambigator.c b/src/ambigator.c index 1e417ce2..d86dc63c 100644 --- a/src/ambigator.c +++ b/src/ambigator.c @@ -146,7 +146,6 @@ static float corr(Crystal *a, Crystal *b, int *pn) s_x2 += aint*aint; s_y2 += bint*bint; n++; - } *pn = n; @@ -156,7 +155,7 @@ static float corr(Crystal *a, Crystal *b, int *pn) if ( (t1 < 0.0) || (t2 <= 0.0) ) return 0.0; - return (s_xy - s_x*s_y)/n/sqrt(t1*t2); + return ((s_xy - s_x*s_y)/n)/sqrt(t1*t2); } @@ -181,8 +180,8 @@ static void detwin(Crystal **crystals, int n_crystals, SymOpList *amb, cc = corr(crystals[i], crystals[j], &n); - if ( i == j ) continue; if ( n < 3 ) continue; + if ( i == j ) continue; if ( assignments[i] == assignments[j] ) { f += cc; |