OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
RNGStream Class Reference

#include <RNGStream.h>

Collaboration diagram for RNGStream:
Collaboration graph
[legend]

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 = NULL
 
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.

Referenced by getInstance().

◆ RNGStream() [2/2]

RNGStream::RNGStream ( unsigned int  seed)
inlineprivate

Definition at line 47 of file RNGStream.h.

◆ ~RNGStream()

RNGStream::~RNGStream ( )
inlineprivate

Definition at line 52 of file RNGStream.h.

Member Function Documentation

◆ deleteInstance()

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

◆ 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 Normal::allocate(), Uniform< T >::allocate(), and LatinHyperCube::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(), and Options::seed.

Here is the call graph for this function:

◆ getNext()

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

◆ setGlobalSeed()

void RNGStream::setGlobalSeed ( unsigned int  seed)
static

Definition at line 53 of file RNGStream.cpp.

References globalInstance_sm, globalSeed_sm, RNGenerator_m, and Options::seed.

Referenced by SampleCmd::execute().

Member Data Documentation

◆ globalInstance_sm

RNGStream * RNGStream::globalInstance_sm = NULL
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(), and setGlobalSeed().

◆ isGlobal_m

bool RNGStream::isGlobal_m
private

Definition at line 59 of file RNGStream.h.

Referenced by deleteInstance().

◆ 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(), and setGlobalSeed().


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