53#if !defined(LIBBRAHE_PRNG_H)
54#define LIBBRAHE_PRNG_H
58#if defined(__cplusplus)
177#if defined(__cplusplus)
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.
static uint32_t BRAHE_UNKNOWN_SEED
Definition prng.h:90
double brahe_prng_real2(brahe_prng_state_t *prng_state)
Get the next number in the range [0,1)
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].
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)
void brahe_prng_free(brahe_prng_state_t *prng_state)
Free resources used by PRNG.
double brahe_prng_real1(brahe_prng_state_t *prng_state)
Get the next number in the range [0,1].
brahe_prng_type_t
Defines types of prngs.
Definition prng.h:64
@ BRAHE_PRNG_ISAAC
Indirect, Shift, Accumulate, Add, and Count (Jenkins)
Definition prng.h:74
@ BRAHE_PRNG_MARSENNE_TWISTER
Marsenne Twister (Matsumoto & Nishimura)
Definition prng.h:66
@ BRAHE_PRNG_MWC1038
MWC1038 (Marsaglia)
Definition prng.h:72
@ BRAHE_PRNG_CMWC4096
CMWC4096 (Marsaglia)
Definition prng.h:70
@ BRAHE_PRNG_KISS
Keep is Simple, Stupid (Marsaglia)
Definition prng.h:68
uint32_t brahe_prng_next(brahe_prng_state_t *prng_state)
Get the next integer.
double brahe_prng_real53(brahe_prng_state_t *prng_state)
Get the next number in the range [0,1)
double brahe_prng_real3(brahe_prng_state_t *prng_state)
Get the next number in the range (0,1)
Contains state variables for a PRNG.
Definition prng.h:79
void * m_data2
Definition prng.h:83
size_t m_b
Definition prng.h:86
void * m_data1
Definition prng.h:82
size_t m_i
Definition prng.h:84
size_t m_a
Definition prng.h:85
size_t m_c
Definition prng.h:87
brahe_prng_type_t m_type
Definition prng.h:80
uint32_t m_seed
Definition prng.h:81