1#ifndef _random_hpp_INCLUDED
2#define _random_hpp_INCLUDED
18 void add (uint64_t a) {
34 uint64_t
seed ()
const {
return state; }
37 state *= 6364136223846793005ul;
38 state += 1442695040888963407ul;
58 const unsigned delta = 1 + r - (unsigned) l;
61 const double fraction = tmp / 4294967296.0;
62 scaled = delta * fraction;
65 const int res = scaled + l;
73 const unsigned delta = 1 + r - (unsigned) l;
74 int log_delta = delta ? 0 : 32;
75 while (log_delta < 32 && (1u << log_delta) < delta)
77 const int log_res =
pick_int (0, log_delta);
80 tmp &= (1u << log_res) - 1;
83 const int res = l + tmp;
#define ABC_NAMESPACE_CXX_HEADER_START
#define ABC_NAMESPACE_CXX_HEADER_END
#define CADICAL_assert(ignore)
void operator+=(uint64_t a)
double pick_double(double l, double r)
void operator=(uint64_t seed)
int pick_log(int l, int r)
Random(const Random &other)
int pick_int(int l, int r)