21#include <spot/misc/common.hh>
37 SPOT_API
void srand(
unsigned int seed);
43 SPOT_API
int rrand(
int min,
int max);
76 template<
double (*gen)()>
81 : n_(n), m_(n * p), s_(sqrt(n * p * (1 - p)))
90 int x = round(gen() * s_ + m_);
108 template<
class iterator_type>
111 auto d = std::distance(first, last);
114 for (--last; first < last; ++first, --d)
117 std::swap(*first, *(first + i));
Compute pseudo-random integer value between 0 and n included, following a binomial distribution with ...
Definition: random.hh:78
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:109
int mrand(int max)
Compute a pseudo-random integer value between 0 and max-1 included.
Definition: automata.hh:26