Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::random::poisson_distribution< IntType, RealType > Class Template Reference

An instantiation of the class template poisson_distribution is a model of . More...

#include <poisson_distribution.hpp>

Classes

class  param_type
 

Public Types

typedef IntType result_type
 
typedef RealType input_type
 

Public Member Functions

 poisson_distribution (RealType mean_arg=RealType(1))
 Constructs a poisson_distribution with the parameter mean. More...
 
 poisson_distribution (const param_type &parm)
 Construct an poisson_distribution object from the parameters. More...
 
template<class URNG >
IntType operator() (URNG &urng) const
 Returns a random variate distributed according to the poisson distribution. More...
 
template<class URNG >
IntType operator() (URNG &urng, const param_type &parm) const
 Returns a random variate distributed according to the poisson distribution with parameters specified by param. More...
 
RealType mean () const
 Returns the "mean" parameter of the distribution. More...
 
IntType min BOOST_PREVENT_MACRO_SUBSTITUTION () const
 Returns the smallest value that the distribution can produce. More...
 
IntType max BOOST_PREVENT_MACRO_SUBSTITUTION () const
 Returns the largest value that the distribution can produce. More...
 
param_type param () const
 Returns the parameters of the distribution. More...
 
void param (const param_type &parm)
 Sets parameters of the distribution. More...
 
void reset ()
 Effects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset. More...
 

Friends

template<class CharT , class Traits >
std::basic_ostream< CharT,
Traits > & 
operator<< (std::basic_ostream< CharT, Traits > &os, const poisson_distribution &pd)
 Writes the parameters of the distribution to a std::ostream. More...
 
template<class CharT , class Traits >
std::basic_istream< CharT,
Traits > & 
operator>> (std::basic_istream< CharT, Traits > &is, poisson_distribution &pd)
 Reads the parameters of the distribution from a std::istream. More...
 
bool operator== (const poisson_distribution &lhs, const poisson_distribution &rhs)
 Returns true if the two distributions will produce the same sequence of values, given equal generators. More...
 
bool operator!= (const poisson_distribution &lhs, const poisson_distribution &rhs)
 Returns true if the two distributions could produce different sequences of values, given equal generators. More...
 

Detailed Description

template<class IntType = int, class RealType = double>
class boost::random::poisson_distribution< IntType, RealType >

An instantiation of the class template poisson_distribution is a model of .

The poisson distribution has $p(i) = \frac{e^{-\lambda}\lambda^i}{i!}$

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

Member Typedef Documentation

template<class IntType = int, class RealType = double>
typedef RealType boost::random::poisson_distribution< IntType, RealType >::input_type
template<class IntType = int, class RealType = double>
typedef IntType boost::random::poisson_distribution< IntType, RealType >::result_type

Constructor & Destructor Documentation

template<class IntType = int, class RealType = double>
boost::random::poisson_distribution< IntType, RealType >::poisson_distribution ( RealType  mean_arg = RealType(1))
inlineexplicit

Constructs a poisson_distribution with the parameter mean.

Requires: mean > 0

References BOOST_ASSERT, and boost::unit_test::framework::init().

Referenced by boost::random::poisson_distribution< IntType, RealType >::operator()().

template<class IntType = int, class RealType = double>
boost::random::poisson_distribution< IntType, RealType >::poisson_distribution ( const param_type parm)
inlineexplicit

Construct an poisson_distribution object from the parameters.

References boost::unit_test::framework::init().

Member Function Documentation

template<class IntType = int, class RealType = double>
IntType min boost::random::poisson_distribution< IntType, RealType >::BOOST_PREVENT_MACRO_SUBSTITUTION ( ) const
inline

Returns the smallest value that the distribution can produce.

template<class IntType = int, class RealType = double>
IntType max boost::random::poisson_distribution< IntType, RealType >::BOOST_PREVENT_MACRO_SUBSTITUTION ( ) const
inline

Returns the largest value that the distribution can produce.

References boost::accumulators::extract::max.

template<class IntType = int, class RealType = double>
RealType boost::random::poisson_distribution< IntType, RealType >::mean ( ) const
inline

Returns the "mean" parameter of the distribution.

template<class IntType = int, class RealType = double>
template<class URNG >
IntType boost::random::poisson_distribution< IntType, RealType >::operator() ( URNG &  urng) const
inline

Returns a random variate distributed according to the poisson distribution.

References boost::range::generate(), and boost::iostreams::grep::invert.

template<class IntType = int, class RealType = double>
template<class URNG >
IntType boost::random::poisson_distribution< IntType, RealType >::operator() ( URNG &  urng,
const param_type parm 
) const
inline

Returns a random variate distributed according to the poisson distribution with parameters specified by param.

References boost::random::poisson_distribution< IntType, RealType >::poisson_distribution().

template<class IntType = int, class RealType = double>
param_type boost::random::poisson_distribution< IntType, RealType >::param ( ) const
inline

Returns the parameters of the distribution.

template<class IntType = int, class RealType = double>
void boost::random::poisson_distribution< IntType, RealType >::param ( const param_type parm)
inline
template<class IntType = int, class RealType = double>
void boost::random::poisson_distribution< IntType, RealType >::reset ( void  )
inline

Effects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset.

Friends And Related Function Documentation

template<class IntType = int, class RealType = double>
bool operator!= ( const poisson_distribution< IntType, RealType > &  lhs,
const poisson_distribution< IntType, RealType > &  rhs 
)
friend

Returns true if the two distributions could produce different sequences of values, given equal generators.

template<class IntType = int, class RealType = double>
template<class CharT , class Traits >
std::basic_ostream<CharT,Traits>& operator<< ( std::basic_ostream< CharT, Traits > &  os,
const poisson_distribution< IntType, RealType > &  pd 
)
friend

Writes the parameters of the distribution to a std::ostream.

template<class IntType = int, class RealType = double>
bool operator== ( const poisson_distribution< IntType, RealType > &  lhs,
const poisson_distribution< IntType, RealType > &  rhs 
)
friend

Returns true if the two distributions will produce the same sequence of values, given equal generators.

template<class IntType = int, class RealType = double>
template<class CharT , class Traits >
std::basic_istream<CharT,Traits>& operator>> ( std::basic_istream< CharT, Traits > &  is,
poisson_distribution< IntType, RealType > &  pd 
)
friend

Reads the parameters of the distribution from a std::istream.


The documentation for this class was generated from the following file: