12 #if !defined(RANDOMLIB_INVERSEEPROB_HPP)
13 #define RANDOMLIB_INVERSEEPROB_HPP 1
32 mutable std::vector<bool> _p;
33 template<
class Random>
bool exph(
Random& r) {
38 for (
bool s =
false; ; s = !s) {
39 for (
size_t i = 0; ; ++i) {
45 if (++i < _p.size()) _p.resize(i);
62 {
return exph(r) && exph(r); }
67 #endif // RANDOMLIB_INVERSEEPROB_HPP
Return true with probability 1/e = exp(−1).
Generate random integers, reals, and booleans.
Header for Random, RandomGenerator.
bool operator()(Random &r)