Go to the source code of this file.
Data Structures | |
struct | tw_rng |
struct | tw_rng_stream |
Typedefs | |
typedef int32_t * | tw_seed |
typedef enum SeedType | SeedType |
Enumerations | |
enum | SeedType { InitialSeed, LastSeed, NewSeed } |
Functions | |
tw_rng * | rng_init (int v, int w) |
void | rng_set_initial_seed () |
void | rng_init_generator (tw_rng_stream *g, SeedType Where) |
void | rng_set_seed (tw_rng_stream *g, uint32_t *s) |
void | rng_get_state (tw_rng_stream *g, uint32_t *s) |
void | rng_write_state (tw_rng_stream *g, FILE *f) |
double | rng_gen_val (tw_rng_stream *g) |
double | rng_gen_reverse_val (tw_rng_stream *g) |
Definition at line 30 of file rand-clcg4.h.
typedef int32_t* tw_seed |
Definition at line 4 of file rand-clcg4.h.
enum SeedType |
Enumerator | |
---|---|
InitialSeed | |
LastSeed | |
NewSeed |
Definition at line 25 of file rand-clcg4.h.
double rng_gen_reverse_val | ( | tw_rng_stream * | g | ) |
Definition at line 451 of file rand-clcg4.c.
References tw_rng::b, tw_rng_stream::Cg, tw_rng_stream::count, tw_rng::m, tw_error(), and TW_LOC.
double rng_gen_val | ( | tw_rng_stream * | g | ) |
Definition at line 392 of file rand-clcg4.c.
References tw_rng_stream::Cg, and tw_rng_stream::count.
void rng_get_state | ( | tw_rng_stream * | g, |
uint32_t * | s | ||
) |
tw_rng* rng_init | ( | int | v, |
int | w | ||
) |
Definition at line 338 of file rand-clcg4.c.
References tw_rng::a, tw_rng::avw, tw_rng::aw, tw_rng::b, clamp_seed(), FindB(), g_tw_rng_seed, tw_rng::m, MultModM(), rng, tw_rng::seed, tw_calloc(), and TW_LOC.
Referenced by tw_rand_init().
void rng_init_generator | ( | tw_rng_stream * | g, |
SeedType | Where | ||
) |
Definition at line 239 of file rand-clcg4.c.
References tw_rng::aw, tw_rng_stream::Cg, tw_rng_stream::Ig, InitialSeed, LastSeed, tw_rng_stream::Lg, tw_rng::m, MultModM(), and NewSeed.
Referenced by rng_set_seed().
void rng_set_initial_seed | ( | ) |
void rng_set_seed | ( | tw_rng_stream * | g, |
uint32_t * | s | ||
) |
void rng_write_state | ( | tw_rng_stream * | g, |
FILE * | f | ||
) |
Definition at line 198 of file rand-clcg4.c.
References tw_rng_stream::Cg.