From 901b9f16494f37890be17ef4bb66e6efc6873340 Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Fri, 10 Feb 2017 12:18:11 -0500 Subject: changed code to rely on jst --- src/rand.c | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 src/rand.c (limited to 'src/rand.c') diff --git a/src/rand.c b/src/rand.c deleted file mode 100644 index 75722ac..0000000 --- a/src/rand.c +++ /dev/null @@ -1,23 +0,0 @@ - -#include "fracture.h" - -unsigned long int rand_seed() { - FILE *f = fopen("/dev/urandom", "r"); - unsigned long int seed; - fread(&seed, sizeof(unsigned long int), 1, f); - fclose(f); - return seed; -} - -long double rand_dist_pow(const gsl_rng *r, double beta) { - long double x = 0; - - // underflow means that for very small beta x is sometimes identically zero, - // which causes problems - while (x == 0.0) { - long double y = logl(gsl_rng_uniform_pos(r)) / beta; - x = expl(y); - } - - return x; -} -- cgit v1.2.3-70-g09d2