![]() |
Home | Libraries | People | FAQ | More |
boost::random::poisson_distribution
// In header: <boost/random/poisson_distribution.hpp> template<typename IntType = int, typename RealType = double> class poisson_distribution { public: // types typedef IntType ; typedef RealType ; // member classes/structs/unions class param_type { public: // types typedef poisson_distribution ; // construct/copy/destruct (RealType = ); // public member functions RealType () ; // friend functions template<typename CharT, typename Traits> CharT, Traits > & (CharT, Traits > &, const param_type &); template<typename CharT, typename Traits> CharT, Traits > & (CharT, Traits > &, param_type &); bool (const param_type &, const param_type &); bool (const param_type &, const param_type &); }; // construct/copy/destruct (RealType = ); (const param_type &); // public member functions template<typename URNG> IntType (URNG &) ; template<typename URNG> IntType (URNG &, const param_type &) ; RealType () ; IntType () ; IntType () ; param_type () ; void (const param_type &); void (); // friend functions template<typename CharT, typename Traits> CharT, Traits > & (CharT, Traits > &, const poisson_distribution &); template<typename CharT, typename Traits> CharT, Traits > & (CharT, Traits > &, poisson_distribution &); bool (const poisson_distribution &, const poisson_distribution &); bool (const poisson_distribution &, const poisson_distribution &); };
An instantiation of the class template poisson_distribution
is a model of random distribution . The poisson distribution has
This implementation is based on the PTRD algorithm described
"The transformed rejection method for generating Poisson random variables", Wolfgang Hormann, Insurance: Mathematics and Economics Volume 12, Issue 1, February 1993, Pages 39-45
poisson_distribution
public
construct/copy/destruct(RealType mean = );
Constructs a
with the parameter poisson_distribution
mean
.
Requires: mean > 0
(const param_type & param);
Construct an
object from the parameters. poisson_distribution
poisson_distribution
public member functionstemplate<typename URNG> IntType (URNG & urng) ;
Returns a random variate distributed according to the poisson distribution.
template<typename URNG> IntType (URNG & urng, const param_type & param) ;
Returns a random variate distributed according to the poisson distribution with parameters specified by param.
RealType () ;
Returns the "mean" parameter of the distribution.
IntType () ;
Returns the smallest value that the distribution can produce.
IntType () ;
Returns the largest value that the distribution can produce.
param_type () ;
Returns the parameters of the distribution.
void (const param_type & param);
Sets parameters of the distribution.
void ();
Effects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset.
poisson_distribution
friend functionstemplate<typename CharT, typename Traits> CharT, Traits > & (CharT, Traits > & os, const poisson_distribution & pd);
Writes the parameters of the distribution to a std::ostream
.
template<typename CharT, typename Traits> CharT, Traits > & (CharT, Traits > & is, poisson_distribution & pd);
Reads the parameters of the distribution from a std::istream
.
bool (const poisson_distribution & lhs, const poisson_distribution & rhs);
Returns true if the two distributions will produce the same sequence of values, given equal generators.
bool (const poisson_distribution & lhs, const poisson_distribution & rhs);
Returns true if the two distributions could produce different sequences of values, given equal generators.