Brahe - a heterogenous collection of mathematical tools
Created by Scott Robert Ladd
Go to the documentation of this file.
53 #if !defined(LIBBRAHE_PRNG_H)
54 #define LIBBRAHE_PRNG_H
58 #if defined(__cplusplus)
177 #if defined(__cplusplus)
double brahe_prng_real1(brahe_prng_state_t *prng_state)
Get the next number in the range [0,1].
static uint32_t BRAHE_UNKNOWN_SEED
Definition: prng.h:90
void brahe_prng_free(brahe_prng_state_t *prng_state)
Free resources used by PRNG.
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)
brahe_prng_type_t
Defines types of prngs.
Definition: prng.h:63
@ BRAHE_PRNG_MARSENNE_TWISTER
Marsenne Twister (Matsumoto & Nishimura)
Definition: prng.h:66
double brahe_prng_real2(brahe_prng_state_t *prng_state)
Get the next number in the range [0,1)
size_t m_b
Definition: prng.h:86
@ BRAHE_PRNG_CMWC4096
CMWC4096 (Marsaglia)
Definition: prng.h:70
@ BRAHE_PRNG_MWC1038
MWC1038 (Marsaglia)
Definition: prng.h:72
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].
size_t m_i
Definition: prng.h:84
brahe_prng_type_t m_type
Definition: prng.h:80
void * m_data2
Definition: prng.h:83
double brahe_prng_real3(brahe_prng_state_t *prng_state)
Get the next number in the range (0,1)
uint32_t m_seed
Definition: prng.h:81
uint32_t brahe_prng_next(brahe_prng_state_t *prng_state)
Get the next integer.
Contains state variables for a PRNG.
Definition: prng.h:78
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.
@ BRAHE_PRNG_KISS
Keep is Simple, Stupid (Marsaglia)
Definition: prng.h:68
double brahe_prng_real53(brahe_prng_state_t *prng_state)
Get the next number in the range [0,1)
@ BRAHE_PRNG_ISAAC
Indirect, Shift, Accumulate, Add, and Count (Jenkins)
Definition: prng.h:74
size_t m_c
Definition: prng.h:87
void * m_data1
Definition: prng.h:82
size_t m_a
Definition: prng.h:85
© 2011 Scott Robert Ladd. All rights reserved.
HTML documentation generated by Dimitri van Heesch's excellent Doxygen tool.