25 #include <spot/misc/common.hh>
41 SPOT_API
void srand(
unsigned int seed);
47 SPOT_API
int rrand(
int min,
int max);
80 template<
double (*gen)()>
85 : n_(n), m_(n * p), s_(sqrt(n * p * (1 - p)))
94 int x = round(gen() * s_ + m_);
112 template<
class iterator_type>
115 auto d = std::distance(first, last);
118 for (--last; first < last; ++first, --d)
121 std::swap(*first, *(first + i));
Compute pseudo-random integer value between 0 and n included, following a binomial distribution with ...
Definition: random.hh:82
double drand()
Compute a pseudo-random double value between 0.0 and 1.0 (1.0 excluded).
void srand(unsigned int seed)
Reset the seed of the pseudo-random number generator.
int rrand(int min, int max)
Compute a pseudo-random integer value between min and max included.
double nrand()
Compute a pseudo-random double value following a standard normal distribution. (Odeh & Evans)
void mrandom_shuffle(iterator_type &&first, iterator_type &&last)
Shuffle the container using mrand function above. This allows to get rid off shuffle or random_shuffl...
Definition: random.hh:113
int mrand(int max)
Compute a pseudo-random integer value between 0 and max-1 included.
Definition: automata.hh:27