12 #ifndef SST_CORE_RNG_MARSAGLIA_H
13 #define SST_CORE_RNG_MARSAGLIA_H
15 #include "sst/core/sst_types.h"
24 #define MARSAGLIA_UINT32_MAX 4294967295U
25 #define MARSAGLIA_UINT64_MAX 18446744073709551615ULL
26 #define MARSAGLIA_INT32_MAX 2147483647L
27 #define MARSAGLIA_INT64_MAX 9223372036854775807LL
51 MarsagliaRNG(
unsigned int initial_z,
unsigned int initial_w);
65 void restart(
unsigned int new_z,
unsigned int new_w);
95 void seed(uint64_t newSeed);
101 unsigned int generateNext();
117 #endif // SST_CORE_RNG_MARSAGLIA_H
Implements the base class for random number generators for the SST core.
Definition: rng.h:27
void seed(uint64_t newSeed)
Seed the XOR RNG.
Definition: marsaglia.cc:142
int64_t generateNextInt64() override
Generates the next number as a signed 64-bit integer.
Definition: marsaglia.cc:104
MarsagliaRNG()
Creates a new Marsaglia RNG using random initial seeds (which are read from the system clock)...
Definition: marsaglia.cc:39
void restart(unsigned int new_z, unsigned int new_w)
Restart the random number generator with new seeds.
Definition: marsaglia.cc:52
int32_t generateNextInt32() override
Generates the next number as a signed 32-bit integer.
Definition: marsaglia.cc:126
Implements a random number generator using the Marsaglia method.
Definition: marsaglia.h:42
uint64_t generateNextUInt64() override
Generates the next random number as an unsigned 64-bit integer.
Definition: marsaglia.cc:88
double nextUniform() override
Generates the next random number as a double in the range 0 to 1.
Definition: marsaglia.cc:76
uint32_t generateNextUInt32() override
Generates the next random number as an unsigned 32-bit integer.
Definition: marsaglia.cc:149