3 #ifndef SPECTMORPH_RANDOM_HH
4 #define SPECTMORPH_RANDOM_HH
9 #include "smpcg32rng.hh"
20 void set_seed (uint32_t seed);
23 random_double_range (
double begin,
double end)
25 const uint32_t rand_max = 0xffffffff;
26 const uint32_t r = random_uint32();
27 const double scale = 1.0 / (double (rand_max) + 1.0);
29 return r * scale * (end - begin) + begin;
37 random_block (
size_t n_values, uint32_t *values)
40 *values++ = random_uint32();
Definition: smpcg32rng.hh:24
uint32_t random()
Generate uniformly distributed 32 bit pseudo random number.
Definition: smpcg32rng.hh:83
Definition: smrandom.hh:15