diff options
author | Thomas White <taw@physics.org> | 2014-09-09 10:38:56 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2014-09-09 10:42:47 +0200 |
commit | 3f8ab3da1cbca9ab821dfa8608bfb7389b99739f (patch) | |
tree | aacdd4d5005e323f30aaba9f75843d981139a35b /src/diffraction.c | |
parent | 2f789e6e769f3521e8925c082cf81eddb30f33fe (diff) |
pattern_sim: Fix handling of centric reflections
Diffstat (limited to 'src/diffraction.c')
-rw-r--r-- | src/diffraction.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/diffraction.c b/src/diffraction.c index 6383a8b4..8a50e115 100644 --- a/src/diffraction.c +++ b/src/diffraction.c @@ -146,25 +146,23 @@ static double sym_lookup_phase(const double *phases, signed int h, signed int k, signed int l) { int i; - double ret = 0.0; for ( i=0; i<num_equivs(sym, NULL); i++ ) { signed int he; signed int ke; signed int le; - double f, val; + double f; get_equiv(sym, NULL, i, h, k, l, &he, &ke, &le); f = (double)lookup_arr_flag(flags, he, ke, le); - val = lookup_arr_phase(phases, he, ke, le); - ret += f*val; + if ( f ) return lookup_arr_phase(phases, he, ke, le); } - return ret; + return 0.0; } |