Implements a Mersenne-based RNG for use in the SST core or components. More...
#include "sst/core/rng/mersenne.h"
Public Member Functions | |
MersenneRNG (unsigned int seed) | |
Create a new Mersenne RNG with a specified seed. | |
MersenneRNG () | |
Creates a new Mersenne using a random seed which is obtained from the system clock. | |
double | nextUniform () |
Generates the next random number as a double value between 0 and 1. | |
uint32_t | generateNextUInt32 () |
Generates the next random number as an unsigned 32-bit integer. | |
uint64_t | generateNextUInt64 () |
Generates the next random number as an unsigned 64-bit integer. | |
int64_t | generateNextInt64 () |
Generates the next random number as a signed 64-bit integer. | |
int32_t | generateNextInt32 () |
Generates the next random number as a signed 32-bit integer. | |
~MersenneRNG () | |
Destructor for Mersenne. |
Implements a Mersenne-based RNG for use in the SST core or components.
The Mersenne RNG provides a better "randomness" to the distribution of outputs but is computationally more expensive than the Marsaglia RNG.
MersenneRNG::MersenneRNG | ( | unsigned int | seed | ) |
Create a new Mersenne RNG with a specified seed.
[in] | seed | The seed for this RNG |
MersenneRNG::MersenneRNG | ( | ) |
Creates a new Mersenne using a random seed which is obtained from the system clock.
Note this will give different results on different platforms and between runs.