71 for(
int th=0; th<a_nbThreads; th++)
73 std::random_device rd;
77 std::random_device rd_single;
100 if(
m_verbose >=3)
Cout(
"sRandomNumberGenerator::Initialize with provided seed..."<< endl);
104 Cout(
"***** sRandomNumberGenerator::Initialize()-> Error : seed for RNG should be >=0 !" << endl);
108 for(
int th=0; th<a_nbThreads; th++)
111 if(
m_verbose>=3)
Cout(
"sRandomNumberGenerator::Initialize()->Seed for thread "<< th <<
" : " << a_seed << endl);
136 #ifdef CASTOR_VERBOSE
137 if(
m_verbose >=4)
Cout(
"sRandomNumberGenerator::GenerateRdmNber..."<< endl);
142 id = omp_get_thread_num();
161 #ifdef CASTOR_VERBOSE
162 if(
m_verbose >=4)
Cout(
"sRandomNumberGenerator::GenerateNonThreadedRdmNber..."<< endl);
182 #ifdef CASTOR_VERBOSE
183 if(
m_verbose >=4)
Cout(
"sRandomNumberGenerator::GetNonThreadedGenerator..."<< endl);
double GenerateRdmNber()
Generate a random number for the thread whose index is recovered from the ompenMP function...
Engine * mp_NonThreadedEngine
double GenerateNonThreadedRdmNber()
Generate a random number using the not thread safe random generator, for use in sequential parts of a...
int Initialize(int a_nbThreads)
Instanciate a number of RNG according to the number of threads used in openMP.
Distribution mp_Distribution
sRandomNumberGenerator()
Constructor of sRandomNumberGenerator. Do nothing by default as it is a singleton clasee...
Singleton class that generate a thread-safe random generator number for openMP As singleton...
Declaration of class sRandomNumberGenerator.
vector< Engine > mp_Engines
static sRandomNumberGenerator * mp_Instance
~sRandomNumberGenerator()
Destructor of sRandomNumberGenerator. Do nothing by default.
Engine * GetNonThreadedGenerator()
Get the not thread safe random generator, for use in sequential parts of an otherwise multithreaded c...