aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/geometry.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2015-08-14 17:45:57 +0200
committerThomas White <taw@physics.org>2015-08-14 17:45:57 +0200
commit8604f4d110e244c8ae6ad1bc2aaad5169b8af116 (patch)
tree8404cb144bfcb553ece5980703d1dfe38a140435 /libcrystfel/src/geometry.c
parent561b165ef8507d8379ff66ab7bd265f977a98f1a (diff)
Improve random partiality model
Diffstat (limited to 'libcrystfel/src/geometry.c')
-rw-r--r--libcrystfel/src/geometry.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/libcrystfel/src/geometry.c b/libcrystfel/src/geometry.c
index cdd936e2..c9e30f4f 100644
--- a/libcrystfel/src/geometry.c
+++ b/libcrystfel/src/geometry.c
@@ -173,22 +173,37 @@ static double random_partiality(signed int h, signed int k, signed int l,
int i;
gsl_rng_set(rng, serial);
+ seed = gsl_rng_get(rng);
+ gsl_rng_set(rng, seed);
+
for ( i=0; i<abs(h)+1; i++ ) {
seed = gsl_rng_get(rng);
}
- if ( h < 0 ) seed = gsl_rng_get(rng);
+ gsl_rng_set(rng, seed);
+ if ( h >= 0 ) {
+ seed = gsl_rng_get(rng);
+ }
+ seed = gsl_rng_get(rng);
gsl_rng_set(rng, seed);
for ( i=0; i<abs(k)+1; i++ ) {
seed = gsl_rng_get(rng);
}
- if ( k < 0 ) seed = gsl_rng_get(rng);
+ gsl_rng_set(rng, seed);
+ if ( k >= 0 ) {
+ seed = gsl_rng_get(rng);
+ }
+ seed = gsl_rng_get(rng);
gsl_rng_set(rng, seed);
for ( i=0; i<abs(l)+1; i++ ) {
seed = gsl_rng_get(rng);
}
- if ( l < 0 ) seed = gsl_rng_get(rng);
+ gsl_rng_set(rng, seed);
+ if ( l >= 0 ) {
+ seed = gsl_rng_get(rng);
+ }
+ seed = gsl_rng_get(rng);
gsl_rng_set(rng, seed);
p = gsl_rng_uniform(rng);