aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2018-11-06 14:32:19 +0100
committerThomas White <taw@physics.org>2018-11-06 14:32:19 +0100
commitfc916fa289b857a869190d4cfb2826555b39854b (patch)
tree8ae6364ebdf7a570d3a0fdd1e281cbb87d8b2f59 /src
parent320a90e3f467d85ba0f7ae44e78d8f62128cc495 (diff)
Separate variable for excluded reflection
It was actually fine, becuase "refl" isn't used again until it's re-set at the start of the next loop iteration. However, it was confusing.
Diffstat (limited to 'src')
-rw-r--r--src/rejection.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/rejection.c b/src/rejection.c
index 8498c380..397aa97a 100644
--- a/src/rejection.c
+++ b/src/rejection.c
@@ -192,6 +192,7 @@ static double calculate_cchalf(RefList *template, RefList *full,
double res;
struct reflection_contributions *c;
Reflection *refl;
+ Reflection *exrefl;
/* The values we need are stored in the "full" list, not the
* template list */
@@ -221,20 +222,20 @@ static double calculate_cchalf(RefList *template, RefList *full,
if ( exclude != NULL ) {
refl = find_refl(crystal_get_reflections(exclude), h, k, l);
} else {
- refl = NULL;
+ exrefl = NULL;
}
- while ( refl != NULL ) {
+ while ( exrefl != NULL ) {
double G, B;
- double Ii = get_intensity(refl);
+ double Ii = get_intensity(exrefl);
G = crystal_get_osf(exclude);
B = crystal_get_Bfac(exclude);
/* Total (multiplicative) correction factor */
- Ii *= 1.0/G * exp(B*res*res) * get_lorentz(refl)
- / get_partiality(refl);
+ Ii *= 1.0/G * exp(B*res*res) * get_lorentz(exrefl)
+ / get_partiality(exrefl);
/* Remove contribution of this reflection */
Ex -= Ii - K;
@@ -242,7 +243,7 @@ static double calculate_cchalf(RefList *template, RefList *full,
n_removed++;
- refl = next_found_refl(refl);
+ exrefl = next_found_refl(exrefl);
}
if ( c->n_contrib - n_removed < 2 ) continue;