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. --- src/scaling-report.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/scaling-report.c') diff --git a/src/scaling-report.c b/src/scaling-report.c index 89b2f3f2..85ed0ad2 100644 --- a/src/scaling-report.c +++ b/src/scaling-report.c @@ -196,6 +196,7 @@ static void partiality_graph(cairo_t *cr, Crystal **crystals, int n, double pcalcmin[nbins]; double pcalcmax[nbins]; int num_nondud; + gsl_rng *rng; show_text_simple(cr, "Observed partiality", -20.0, g_height/2.0, NULL, -M_PI_2, J_CENTER); @@ -223,6 +224,10 @@ static void partiality_graph(cairo_t *cr, Crystal **crystals, int n, num_nondud++; } + /* The reflections chosen for the graph will be the same every time + * (given the same sequence of input reflections, scalabilities etc) */ + rng = gsl_rng_alloc(gsl_rng_mt19937); + cairo_set_source_rgb(cr, 0.0, 0.7, 0.0); prob = 1.0 / num_nondud; for ( i=0; i