50 int imax = std::numeric_limits<int>::max();
52 std::uniform_int_distribution<> dist(0, imax);
54 this->
seed = dist(
rg.at(0));
63 this->
seed = new_seed;
67 int imax = std::numeric_limits<int>::max();
69 std::uniform_int_distribution<> dist(0, imax);
71 for (
size_t i = 1;
i <
rg.size(); ++
i)
72 rg.at(
i).seed(dist(
rg.at(0)));
79 std::uniform_int_distribution<> dist( lowerLimit, upperLimit );
85 std::uniform_real_distribution<float> dist(min, max);
91 std::uniform_real_distribution<float> dist(min, max);
165 v1=float(2.0*
rnd_flt(-1,1)-1.0);
166 v2=float(2.0*
rnd_flt(-1,1)-1.0);
168 }
while (rsq >= 1.0 || rsq == 0.0);
169 fac=float(sqrt(-2.0*log(rsq)/rsq));
Defines a multi-core random number generator and its operators.
float rnd_dbl(float min=0.0, float max=1.0)
int rnd_int(int lowerLimit, int upperLimit)
void set_seed(int new_seed)
vector< std::mt19937 > rg
float rnd_flt(float min=0.0, float max=1.0)
#define omp_get_max_threads()
#define omp_get_thread_num()