From cf6d943f2d01e956e2735c98b610906df9273733 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 31 Aug 2018 20:31:30 +0200 Subject: Handle each unique reflection only once --- src/rejection.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/rejection.c') diff --git a/src/rejection.c b/src/rejection.c index 47cc9347..b4e16f17 100644 --- a/src/rejection.c +++ b/src/rejection.c @@ -104,6 +104,9 @@ static double calculate_cchalf(RefList *template, RefList *full, double all_sum_var = 0.0; double sig2E, sig2Y; int n = 0; + signed int oh = 0; + signed int ok = 0; + signed int ol = 0; /* Iterate over all reflections */ for ( trefl = first_refl(template, &iter); @@ -120,6 +123,13 @@ static double calculate_cchalf(RefList *template, RefList *full, Reflection *refl; get_indices(trefl, &h, &k, &l); + + /* next_refl() will iterate over multiple copies of the same + * unique reflection, but we are only interested in seeing each + * unique reflection once. */ + if ( (h==oh) && (k==ok) && (l==ol) ) continue; + oh = h; ok = k; ol = l; + refl = find_refl(full, h, k, l); if ( refl == NULL ) continue; -- cgit v1.2.3