diff options
author | Thomas White <taw@physics.org> | 2018-08-31 20:31:30 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2018-08-31 20:31:30 +0200 |
commit | cf6d943f2d01e956e2735c98b610906df9273733 (patch) | |
tree | 68886774e5ff5eb4e6a57fe4cad4dcc31f120770 /src/rejection.c | |
parent | 69ee7568d425c531991e708f1a0ad9f48bf0b4c9 (diff) |
Handle each unique reflection only once
Diffstat (limited to 'src/rejection.c')
-rw-r--r-- | src/rejection.c | 10 |
1 files changed, 10 insertions, 0 deletions
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; |