SPRAAK
|
Generating peudo random numbers. More...
Typedefs | |
typedef struct SprRandGen | SprRandGen |
Functions | |
void | spr_rand_init (SprRandGen *restrict rg_state, const uint32_t *val, int Nval) |
uint32_t | spr_rand_u32 (SprRandGen *restrict rg_state) |
uint64_t | spr_rand_u64 (SprRandGen *restrict rg_state) |
float | spr_rand_f32 (SprRandGen *restrict rg_state) |
double | spr_rand_f64q (SprRandGen *restrict rg_state) |
Calculate the next 32 (pseudo) random bits and update the state of the random generator rg_state. More... | |
double | spr_rand_f64 (SprRandGen *restrict rg_state) |
double | spr_randn_f64 (SprRandGen *restrict rg_state) |
unsigned int | spr_rand_modN (unsigned int n, SprRandGen *restrict rg_state) |
float * | spr_rand_vec_f32 (float x[], int n, float rmax, SprRandGen *restrict rg_state) |
float * | spr_randn_vec_f32 (float x[], int n, SprRandGen *restrict rg_state) |
int | spr_rand_m (int indx[], int n, int m, SprRandGen *restrict rg_state) |
Variables | |
SprRandGen | spr_rand_default |
Generating peudo random numbers.
Generate pseudo random number. Multiple generators can be generated. The global generator is MT-safe in the sense that it will not crash and will provide randon numbers. However, even after reorganizing the random numbers, the sequence may still differ from those returned in an equivalent single threaded application.