aboutsummaryrefslogtreecommitdiff
path: root/tests/pr_p_gradient_check.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2014-01-17 16:52:57 +0100
committerThomas White <taw@physics.org>2014-01-20 17:20:14 +0100
commit90ee3c269580104f2d16d28aeaa565063f6fc1f2 (patch)
treebd3c69f932648dc6fb01e4cce69bd27fb4831be2 /tests/pr_p_gradient_check.c
parent8e2f2f44f46c18f7bd621a2ef9a3d0aa813d76d9 (diff)
RNG overhaul
Previously, we were using random(), which is really really bad.
Diffstat (limited to 'tests/pr_p_gradient_check.c')
-rw-r--r--tests/pr_p_gradient_check.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/pr_p_gradient_check.c b/tests/pr_p_gradient_check.c
index 9adf4780..c0582036 100644
--- a/tests/pr_p_gradient_check.c
+++ b/tests/pr_p_gradient_check.c
@@ -3,11 +3,11 @@
*
* Check partiality gradients for post refinement
*
- * Copyright © 2012-2013 Deutsches Elektronen-Synchrotron DESY,
+ * Copyright © 2012-2014 Deutsches Elektronen-Synchrotron DESY,
* a research centre of the Helmholtz Association.
*
* Authors:
- * 2012-2013 Thomas White <taw@physics.org>
+ * 2012-2014 Thomas White <taw@physics.org>
*
* This file is part of CrystFEL.
*
@@ -397,6 +397,7 @@ int main(int argc, char *argv[])
int quiet = 0;
int plot = 0;
int c;
+ gsl_rng *rng;
const struct option longopts[] = {
{"quiet", 0, &quiet, 1},
@@ -447,12 +448,14 @@ int main(int argc, char *argv[])
deg2rad(90.0),
deg2rad(90.0));
+ rng = gsl_rng_alloc(gsl_rng_mt19937);
+
for ( i=0; i<1; i++ ) {
UnitCell *rot;
double val;
- orientation = random_quaternion();
+ orientation = random_quaternion(rng);
rot = cell_rotate(cell, orientation);
crystal_set_cell(cr, rot);
@@ -511,5 +514,7 @@ int main(int argc, char *argv[])
}
+ gsl_rng_free(rng);
+
return fail;
}