17 static const unsigned DEGREE_MAX = 32;
19 static const unsigned BIT[ 1 + DEGREE_MAX ] = {
62 static const unsigned MASK[ 1 + DEGREE_MAX ] = {
72 BIT[4] + BIT[3] + BIT[2],
76 BIT[6] + BIT[4] + BIT[1],
77 BIT[4] + BIT[3] + BIT[1],
78 BIT[5] + BIT[3] + BIT[1],
80 BIT[5] + BIT[3] + BIT[2],
82 BIT[5] + BIT[2] + BIT[1],
83 BIT[5] + BIT[2] + BIT[1],
88 BIT[4] + BIT[3] + BIT[1],
90 BIT[6] + BIT[2] + BIT[1],
91 BIT[5] + BIT[2] + BIT[1],
94 BIT[6] + BIT[4] + BIT[1],
96 BIT[7] + BIT[5] + BIT[3] + BIT[2] + BIT[1]
132 double beta(
double v,
double w,
133 double xMin = 0.,
double xMax = 1. );
134 double gamma(
double a,
double b,
double c );
139 double normal(
double mu = 0.,
double sigma = 1. );
141 double uniform(
double xMin = 0.,
double xMax = 1. );
159 std::array<double,2> pXY;
162 static constexpr int32_t _M = 0x7fffffff;
163 static constexpr int32_t A_ = 0x10ff5;
164 static constexpr int32_t Q_ = 0x787d;
165 static constexpr int32_t R_ = 0x5d5e;
166 static constexpr
double _F = 1. / _M;
167 static constexpr
short _NTAB = 32;
168 static constexpr int32_t _DIV = 1+(_M-1)/_NTAB;
169 int32_t _table[ _NTAB ];
178 double normalModified(
double mu = 0.,
Random numbers engine with additional distributions.
Definition: Random.h:109
Random(const Random &r)=default
copy constructor (copies current state)
double beta(double v, double w, double xMin=0., double xMax=1.)
Beta (v > 0. and w > 0.)
double pR2
cache for the squared norm of pXY
Definition: Random.h:158
int32_t getSeed()
Return the current seed value.
double normal(double mu=0., double sigma=1.)
Normal (Gaussian)
bool f
true if new uniform variates need to be pulled, false if the data here is usable
Definition: Random.h:157
Random(int32_t seed)
constructor to set the seed
void reset()
reset seed from current process id
friend bool operator==(const Random &a, const Random &b)
Compare internal state of generators
double uniform(double xMin=0., double xMax=1.)
Uniform on [xMin,xMax)
double exponential(double a=0., double c=1.)
int uniformDiscrete(int i, int j)
Random(int32_t seed, bool f)
constructor to set the seed and the modified state
Random()
constructor to autogenerate a seed
void reset(int32_t seed)
reset the seed explicitly
double gamma(double a, double b, double c)
friend bool operator!=(const Random &a, const Random &b)
Compare internal state of generators
Definition: Random.h:116
Random & operator=(const Random &r)=default
overloaded assignment (replaces state)
int poisson(double mu)
Poisson.