10template <
typename Scalar,
typename RealScalar>
16 static thread_local std::mt19937 generatorUniformReal(std::random_device{}());
17 if(FIXED_SEED) generatorUniformReal.seed(std::time(0));
18 std::uniform_real_distribution<double> distribution(min, max);
19 return distribution(generatorUniformReal);
23inline std::complex<double> threadSafeRandUniform<std::complex<double>,
double>(
double min,
double max,
bool FIXED_SEED)
25 static thread_local std::mt19937 generatorUniformComplex(std::random_device{}());
26 if(FIXED_SEED) generatorUniformComplex.seed(std::time(0));
27 std::uniform_real_distribution<double> distribution(min, max);
28 return std::complex<double>(distribution(generatorUniformComplex), distribution(generatorUniformComplex));
34 static thread_local std::mt19937 generatorUniformInt(std::random_device{}());
35 if(FIXED_SEED) generatorUniformInt.seed(std::time(0));
36 std::uniform_int_distribution<int> distribution(min, max);
37 return distribution(generatorUniformInt);
double threadSafeRandUniform< double, double >(double min, double max, bool FIXED_SEED)
Definition: Random.hpp:14
int threadSafeRandUniform< int, int >(int min, int max, bool FIXED_SEED)
Definition: Random.hpp:32
Scalar threadSafeRandUniform(RealScalar, RealScalar, bool=false)
Definition: Random.hpp:11