From 90ee3c269580104f2d16d28aeaa565063f6fc1f2 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 17 Jan 2014 16:52:57 +0100 Subject: RNG overhaul Previously, we were using random(), which is really really bad. --- tests/pr_p_gradient_check.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'tests/pr_p_gradient_check.c') 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 + * 2012-2014 Thomas White * * 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; } -- cgit v1.2.3