OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
RNGStream Class Reference

#include <RNGStream.h>

Collaboration diagram for RNGStream:

Public Member Functions

std::mt19937_64 & getGenerator ()
template<class DISTR>
DISTR::result_type getNext (DISTR &RNGDist)

Static Public Member Functions

static RNGStreamgetInstance ()
static RNGStreamgetInstance (unsigned int seed)
static void deleteInstance (RNGStream *&generator)
static void setGlobalSeed (unsigned int seed)
static unsigned int getGlobalSeed ()

Private Member Functions

 RNGStream ()
 RNGStream (unsigned int seed)
 ~RNGStream ()

Private Attributes

std::mt19937_64 RNGenerator_m
bool isGlobal_m

Static Private Attributes

static RNGStreamglobalInstance_sm = nullptr
static unsigned int globalSeed_sm = 42
static unsigned int numGlobalInstances_sm = 0

Detailed Description

Definition at line 23 of file RNGStream.h.

Constructor & Destructor Documentation

◆ RNGStream() [1/2]

RNGStream::RNGStream ( )
inlineprivate

Definition at line 42 of file RNGStream.h.

References globalSeed_sm, isGlobal_m, and RNGenerator_m.

Referenced by deleteInstance(), getInstance(), and getInstance().

◆ RNGStream() [2/2]

RNGStream::RNGStream ( unsigned int seed)
inlineprivate

Definition at line 47 of file RNGStream.h.

References isGlobal_m, and RNGenerator_m.

◆ ~RNGStream()

RNGStream::~RNGStream ( )
inlineprivate

Definition at line 52 of file RNGStream.h.

Member Function Documentation

◆ deleteInstance()

void RNGStream::deleteInstance ( RNGStream *& generator)
static

Definition at line 38 of file RNGStream.cpp.

References isGlobal_m, numGlobalInstances_sm, and RNGStream().

Referenced by LatinHyperCube::~LatinHyperCube(), Normal::~Normal(), and Uniform< T >::~Uniform().

Here is the call graph for this function:

◆ getGenerator()

std::mt19937_64 & RNGStream::getGenerator ( )

Definition at line 64 of file RNGStream.cpp.

References RNGenerator_m.

◆ getGlobalSeed()

unsigned int RNGStream::getGlobalSeed ( )
static

Definition at line 60 of file RNGStream.cpp.

References globalSeed_sm.

◆ getInstance() [1/2]

RNGStream * RNGStream::getInstance ( )
static

Definition at line 26 of file RNGStream.cpp.

References globalInstance_sm, numGlobalInstances_sm, and RNGStream().

Referenced by LatinHyperCube::allocate(), Normal::allocate(), and Uniform< T >::allocate().

Here is the call graph for this function:

◆ getInstance() [2/2]

RNGStream * RNGStream::getInstance ( unsigned int seed)
static

Definition at line 34 of file RNGStream.cpp.

References RNGStream().

Here is the call graph for this function:

◆ getNext()

template<class DISTR>
DISTR::result_type RNGStream::getNext ( DISTR & RNGDist)
inline

Definition at line 37 of file RNGStream.h.

References RNGenerator_m.

◆ setGlobalSeed()

void RNGStream::setGlobalSeed ( unsigned int seed)
static

Definition at line 53 of file RNGStream.cpp.

References globalInstance_sm, and globalSeed_sm.

Referenced by SampleCmd::execute().

Member Data Documentation

◆ globalInstance_sm

RNGStream * RNGStream::globalInstance_sm = nullptr
staticprivate

Definition at line 55 of file RNGStream.h.

Referenced by getInstance(), and setGlobalSeed().

◆ globalSeed_sm

unsigned int RNGStream::globalSeed_sm = 42
staticprivate

Definition at line 56 of file RNGStream.h.

Referenced by getGlobalSeed(), RNGStream(), and setGlobalSeed().

◆ isGlobal_m

bool RNGStream::isGlobal_m
private

Definition at line 59 of file RNGStream.h.

Referenced by deleteInstance(), RNGStream(), and RNGStream().

◆ numGlobalInstances_sm

unsigned int RNGStream::numGlobalInstances_sm = 0
staticprivate

Definition at line 57 of file RNGStream.h.

Referenced by deleteInstance(), and getInstance().

◆ RNGenerator_m

std::mt19937_64 RNGStream::RNGenerator_m
private

Definition at line 58 of file RNGStream.h.

Referenced by getGenerator(), getNext(), RNGStream(), and RNGStream().


The documentation for this class was generated from the following files: