binomial_distribution (_IntType __t, double __p=0.5)
binomial_distribution (const param_type &__p)
template<typename _ForwardIterator, typename _UniformRandomNumberGenerator>
void __generate (_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator &__urng)
template<typename _ForwardIterator, typename _UniformRandomNumberGenerator>
void __generate (_ForwardIterator __f, _ForwardIterator __t, _UniformRandomNumberGenerator &__urng, const param_type &__p)
template<typename _UniformRandomNumberGenerator>
void __generate (result_type *__f, result_type *__t, _UniformRandomNumberGenerator &__urng, const param_type &__p)
result_type max () const
result_type min () const
template<typename _UniformRandomNumberGenerator>
result_type operator() (_UniformRandomNumberGenerator &__urng)
template<typename _UniformRandomNumberGenerator>
result_type operator() (_UniformRandomNumberGenerator &__urng, const param_type &__p)
double p () const
param_type param () const
void param (const param_type &__param)
void reset ()
_IntType t () const
template<typename _IntType = int>
class std::binomial_distribution< _IntType >
A discrete binomial random number distribution.
The formula for the binomial probability density function is where and are the parameters of the distribution.
Since C++11
Definition at line 3953 of file random.h .
template<typename _IntType>
template<typename _UniformRandomNumberGenerator>
A rejection algorithm when t * p >= 8 and a simple waiting time method - the second in the referenced book - otherwise. NB: The former is available only if _GLIBCXX_USE_C99_MATH_FUNCS is defined.
Reference: Devroye, L. Non-Uniform Random Variates Generation. Springer-Verlag, New York, 1986, Ch. X, Sect. 4 (+ Errata!).
Definition at line 1569 of file bits/random.tcc .
References std::numeric_limits< _Tp >::epsilon() , and std::numeric_limits< _Tp >::max() .