QMCPACK
RandomGenerator.h File Reference

Declare a global Random Number Generator. More...

+ Include dependency graph for RandomGenerator.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  RNGThreadSafe< RNG >
 

Namespaces

 qmcplusplus
 helper functions for EinsplineSetBuilder
 

Macros

#define Random   random_global
 

Typedefs

using RandomGenerator = StdRandom< OHMMS_PRECISION_FULL >
 

Functions

uint32_t make_seed (int i, int n)
 

Detailed Description

Declare a global Random Number Generator.

Selected among

  • std::mt19937 qmcplusplus::Random() returns a random number [0,1) For OpenMP is enabled, it is important to use thread-safe boost::random. Each thread uses its own random number generator with a distinct seed. This prevents a use of global lock which will slow down the applications significantly.

Definition in file RandomGenerator.h.

Macro Definition Documentation

◆ Random

Function Documentation

◆ make_seed()

uint32_t make_seed ( int  i,
int  n 
)

Definition at line 17 of file RandomGenerator.cpp.

References qmcplusplus::n.

Referenced by qmcplusplus::TEST_CASE().

17 { return static_cast<uint32_t>(std::time(0)) % 10474949 + (i + 1) * n + i; }