NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
ThreadsafeRandGen Class Reference

This class represents a thread safe random number generator (it is a container for multiple generator instances, each for every possible OMP thread). More...

Collaboration diagram for ThreadsafeRandGen:

Public Member Functions

 ThreadsafeRandGen ()
 Create an instance of this thread safe random number generator by filling the internal array with the number of maximal possible OMP threads. More...
 
std::mt19937 & getGenerator ()
 Returns an instance of a random number generator for the current thread. More...
 

Private Attributes

std::vector< std::mt19937 > m_randGenArray
 

Detailed Description

This class represents a thread safe random number generator (it is a container for multiple generator instances, each for every possible OMP thread).

Definition at line 33 of file tools.cpp.

Constructor & Destructor Documentation

◆ ThreadsafeRandGen()

ThreadsafeRandGen::ThreadsafeRandGen ( )
inline

Create an instance of this thread safe random number generator by filling the internal array with the number of maximal possible OMP threads.

Definition at line 45 of file tools.cpp.

References m_randGenArray.

Member Function Documentation

◆ getGenerator()

std::mt19937 & ThreadsafeRandGen::getGenerator ( )
inline

Returns an instance of a random number generator for the current thread.

Returns
std::mt19937&

Definition at line 62 of file tools.cpp.

References m_randGenArray.

Referenced by getRandGenInstance().

Member Data Documentation

◆ m_randGenArray

std::vector<std::mt19937> ThreadsafeRandGen::m_randGenArray
private

Definition at line 36 of file tools.cpp.

Referenced by getGenerator(), and ThreadsafeRandGen().


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