diff options
author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2017-02-10 12:19:46 -0500 |
---|---|---|
committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2017-02-10 12:19:46 -0500 |
commit | 0ef0c0ce1d904be2b4e1f4da62dc029d8572c983 (patch) | |
tree | 12978013d870186240c08d1fdd6a7ce8781bca93 /src/rand.c | |
parent | 9a93a3b88a604672f557950e6c7f3fe815bcf163 (diff) | |
parent | 901b9f16494f37890be17ef4bb66e6efc6873340 (diff) | |
download | fuse_networks-0ef0c0ce1d904be2b4e1f4da62dc029d8572c983.tar.gz fuse_networks-0ef0c0ce1d904be2b4e1f4da62dc029d8572c983.tar.bz2 fuse_networks-0ef0c0ce1d904be2b4e1f4da62dc029d8572c983.zip |
Merge branch 'tmp'
Diffstat (limited to 'src/rand.c')
-rw-r--r-- | src/rand.c | 23 |
1 files changed, 0 insertions, 23 deletions
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; -} |