SST
14.0.0
StructuralSimulationToolkit
|
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. More... | |
MersenneRNG () | |
Creates a new Mersenne using a random seed which is obtained from the system clock. More... | |
double | nextUniform () override |
Generates the next random number as a double value between 0 and 1. | |
uint32_t | generateNextUInt32 () override |
Generates the next random number as an unsigned 32-bit integer. | |
uint64_t | generateNextUInt64 () override |
Generates the next random number as an unsigned 64-bit integer. | |
int64_t | generateNextInt64 () override |
Generates the next random number as a signed 64-bit integer. | |
int32_t | generateNextInt32 () override |
Generates the next random number as a signed 32-bit integer. | |
void | seed (uint64_t newSeed) |
Seed the XOR RNG. | |
~MersenneRNG () | |
Destructor for Mersenne. | |
void | serialize_order (SST::Core::Serialization::serializer &ser) override |
Serialization function for checkpoint. | |
![]() | |
virtual | ~Random () |
Destroys the random number generator. | |
virtual void | serialize_order (SST::Core::Serialization::serializer &UNUSED(ser)) override |
![]() | |
virtual const char * | cls_name () const =0 |
virtual uint32_t | cls_id () const =0 |
virtual std::string | serialization_name () const =0 |
Data Fields | |
ImplementSerializable(SST::RNG::MersenneRNG) private uint32_t * | numbers |
Serialization macro. More... | |
int | index |
Tells us what index of the random number list the next returnable number should come from. | |
Additional Inherited Members | |
![]() | |
static constexpr uint32_t | NullClsId = std::numeric_limits<uint32_t>::max() |
![]() | |
enum | cxn_flag_t { ConstructorFlag } |
![]() | |
static void | serializable_abort (uint32_t line, const char *file, const char *func, const char *obj) |
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 |
References seed().
MersenneRNG::MersenneRNG | ( | ) |
ImplementSerializable (SST::RNG::MersenneRNG) private uint32_t* SST::RNG::MersenneRNG::numbers |
Serialization macro.
Generates the next batch of random numbers Stores the next set of random numbers
Referenced by generateNextUInt32(), MersenneRNG(), seed(), serialize_order(), and ~MersenneRNG().