10 #if !defined(EXRANDOM_DISCRETE_NORMAL_DISTRIBUTION_HPP) 11 #define EXRANDOM_DISCRETE_NORMAL_DISTRIBUTION_HPP 1 35 static const uint_t _base = 1UL<<16;
110 : _param(p), _normal_dist(_D, _param) {}
121 : _param(mu, sigma), _normal_dist(_D, _param) {}
152 , _normal_dist(_D, _param) {}
186 { _param =
param; _normal_dist.init(_param); }
192 {
return std::numeric_limits<result_type>::min(); }
198 {
return std::numeric_limits<result_type>::max(); }
205 template<
typename Generator>
207 {
return _normal_dist(g); }
215 template<
typename Generator>
235 {
return !(d1 == d2); }
247 { os << x.
param();
return os; }
273 #endif // EXRANDOM_DISCRETE_NORMAL_DISTRIBUTION_HPP discrete_normal_distribution(int mu_num, int mu_den, int sigma_num, int sigma_den)
friend std::ostream & operator<<(std::ostream &os, const discrete_normal_distribution &x)
result_type sigma_num() const
param_type(int mu, int sigma)
friend std::istream & operator>>(std::istream &is, discrete_normal_distribution &x)
friend bool operator!=(const discrete_normal_distribution &d1, const discrete_normal_distribution &d2)
discrete_normal_distribution distribution_type
result_type operator()(Generator &g, const param_type &p)
Machinery to convert a random generator into a random digit.
friend bool operator==(const discrete_normal_distribution &d1, const discrete_normal_distribution &d2)
param_type(int mu_num, int mu_den, int sigma_num, int sigma_den)
result_type sigma_den() const
result_type operator()(Generator &g)
result_type mu_num() const
param_type(int mu_num, int sigma_num, int den)
Definition of rand_digit.
discrete_normal_distribution()
Partially sample exactly from the discrete normal distribution.
discrete_normal_distribution(int mu, int sigma)
discrete_normal_distribution(int mu_num, int sigma_num, int den)
Sample exactly from the discrete normal distribution.
void param(const param_type ¶m)
Definition of discrete_normal_dist.
result_type mu_den() const
discrete_normal_distribution(const param_type &p)
Parameter type for discrete_normal_distribution.