63 #ifndef _biomcmc_random_number_h_ 64 #define _biomcmc_random_number_h_ 66 #include "random_number_gen.h" 103 biomcmc_rng
new_biomcmc_rng (
unsigned long long int seed,
int stream_number);
MT19937-64, the Mersenne Twister for 64 bits.
Definition: random_number_gen.h:31
uint32_t biomcmc_rng_get_32(void)
new value with 32 random bits
Definition: random_number.c:217
double biomcmc_rng_get_52(void)
new value with 52 random bits as a double precision float
Definition: random_number.c:208
rng_mt19937_struct mt
Tausworthe linear feedback shift-register from GSL.
Definition: random_number.h:74
unsigned long long int biomcmc_rng_get_initial_seed(void)
Create initial seed based on time, combining time in microseconds and seconds (user-controled seed is...
Definition: random_number.c:66
double biomcmc_rng_unif_pos(void)
Returns a positive random number between 0 and 1 (excluding 0 and including 1) (52 bits)...
Definition: random_number.c:170
double rnorm32
when using 32 bits we first check if we have one stored
Definition: random_number.h:79
double biomcmc_elapsed_time(int *now, int *past)
returns the floating-point time in seconds elapsed between past[2] and now[2]
Definition: random_number.c:257
void biomcmc_random_number_init(unsigned long long int seed)
High-level setup of a simple random number generator and initialization with a seed (not to be mixed ...
Definition: random_number.c:22
void del_biomcmc_rng(biomcmc_rng r)
Release memory occupied by biomcmc_rng::
Definition: random_number.c:60
void biomcmc_random_number_finalize(void)
High-level finalization (memory release etc.) of the random number environment.
Definition: random_number.c:33
uint64_t bit32
64 bits Mersenne Twister from Matsumoto's webpage
Definition: random_number.h:76
double biomcmc_rng_snorm32(void)
Returns a random number from a Standard Normal distribution N(0,1) - prob_distribution.h has general case.
Definition: random_number.c:111
bool have_bit32
temporary values when only 32 bits are necessary
Definition: random_number.h:77
Definition: random_number_gen.h:24
bool have_rnorm32
stored standard normal random values with 32 and 52 bits of precision
Definition: random_number.h:80
double biomcmc_rng_unif(void)
Returns a random number between 0 and 1 (including 1) with precision (52 bits).
Definition: random_number.c:156
biomcmc_rng new_biomcmc_rng(unsigned long long int seed, int stream_number)
Allocate memory for new (Tausworthe + MT19937) generator from a pool of streams.
Definition: random_number.c:41
Random number structure (combined Tausworthe algorithm)
Definition: random_number.h:71
void biomcmc_get_time(int *time)
get current time with maximum precision and soter in vector time[2]
Definition: random_number.c:235
uint64_t biomcmc_rng_unif_int64(uint64_t n)
Returns a long integer (64 bits) random number between 0 and n (excluding n), with ...
Definition: random_number.c:190
double biomcmc_rng_unif32(void)
Returns a random number between 0 and 1 (including 1) with precision (32 int bits).
Definition: random_number.c:150
uint32_t biomcmc_rng_unif_int(uint32_t n)
Returns an integer (32 bits) random number between 0 and n (excluding n), provided approx...
Definition: random_number.c:178
double biomcmc_rng_snorm(void)
Returns a random number from a Standard Normal distribution with maximum (52 bits) integer precision...
Definition: random_number.c:130
double biomcmc_rng_unif_pos32(void)
Returns a positive random number between 0 and 1 (including 1) (32 int bits).
Definition: random_number.c:162
biomcmc_rng new_biomcmc_rng_from_seed(unsigned long long int seed, int stream_number)
Generate a vector of seeds (based on initial one), create and initialize stream with an element of th...
Definition: random_number.c:89
biomcmc_rng biomcmc_random_number
pointer to pseudo-random number generator (should point to real stream, even when there are several) ...
Definition: random_number.c:17
uint64_t biomcmc_rng_get(void)
new value with 64 random bits
Definition: random_number.c:202