53 #if !defined(LIBBRAHE_PRNG_H) 54 #define LIBBRAHE_PRNG_H 58 #if defined(__cplusplus) 177 #if defined(__cplusplus) double brahe_prng_real53(brahe_prng_state_t *prng_state)
Get the next number in the range [0,1)
double brahe_prng_real1(brahe_prng_state_t *prng_state)
Get the next number in the range [0,1].
Contains state variables for a PRNG.
Definition: prng.h:78
bool brahe_prng_init(brahe_prng_state_t *prng_state, const brahe_prng_type_t type, const uint32_t seed)
Initialize a psuedo-random number generator (PRNG)
static uint32_t BRAHE_UNKNOWN_SEED
Definition: prng.h:90
Indirect, Shift, Accumulate, Add, and Count (Jenkins)
Definition: prng.h:74
uint32_t brahe_prng_range(brahe_prng_state_t *prng_state, const uint32_t lo, const uint32_t hi)
Get the next integer in the range [lo,hi].
Keep is Simple, Stupid (Marsaglia)
Definition: prng.h:68
size_t m_a
Definition: prng.h:85
uint32_t brahe_prng_next(brahe_prng_state_t *prng_state)
Get the next integer.
double brahe_prng_real3(brahe_prng_state_t *prng_state)
Get the next number in the range (0,1)
brahe_prng_type_t m_type
Definition: prng.h:80
size_t m_i
Definition: prng.h:84
brahe_prng_type_t
Defines types of prngs.
Definition: prng.h:63
size_t m_b
Definition: prng.h:86
CMWC4096 (Marsaglia)
Definition: prng.h:70
MWC1038 (Marsaglia)
Definition: prng.h:72
double brahe_prng_real2(brahe_prng_state_t *prng_state)
Get the next number in the range [0,1)
void * m_data2
Definition: prng.h:83
void * m_data1
Definition: prng.h:82
Marsenne Twister (Matsumoto & Nishimura)
Definition: prng.h:66
size_t m_c
Definition: prng.h:87
size_t brahe_prng_index(brahe_prng_state_t *prng_state, const size_t length)
Get the next random value as a size_t index.
void brahe_prng_free(brahe_prng_state_t *prng_state)
Free resources used by PRNG.
uint32_t m_seed
Definition: prng.h:81