10 static std::minstd_rand0 u;
18 static std::random_device rd;
30 return generator() & 1;
40 static std::uniform_int_distribution<int> d;
41 using parm_t =
decltype(d)::param_type;
52 static std::uniform_real_distribution<float> d;
53 using parm_t =
decltype(d)::param_type;
69 static std::uniform_int_distribution<uint32_t> d;
70 using parm_t =
decltype(d)::param_type;
auto & global_urng()
Return reference to a (shared) global random number generator.
void randomize()
Seed the (shared) random number generator.
int random_int(int from, int thru)
Return a random integer in the range [from, thru] (note: closed interval).
uint32_t random_32bit()
Return a random 32-bit value.
bool random_bool()
Return a random boolean value.
float random_float(float from, float upto)
Return a random float in the range [from, upto) (note: half-open interval).