![]() |
Home | Libraries | People | FAQ | More |
boost::random::exponential_distribution
// In header: <boost/random/exponential_distribution.hpp> template<typename RealType = double> class exponential_distribution { public: // types typedef RealType ; typedef RealType ; // member classes/structs/unions class param_type { public: // types typedef exponential_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 > &, const 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 RealType () ; RealType () ; RealType () ; param_type () ; void (const param_type &); void (); template<typename Engine> result_type (Engine &) ; template<typename Engine> result_type (Engine &, const param_type &) ; // friend functions template<typename CharT, typename Traits> CharT, Traits > & (CharT, Traits > &, const exponential_distribution &); template<typename CharT, typename Traits> CharT, Traits > & (CharT, Traits > &, const exponential_distribution &); bool (const exponential_distribution &, const exponential_distribution &); bool (const exponential_distribution &, const exponential_distribution &); };
The exponential distribution is a model of random distribution with a single parameter lambda.
It has
The implementation uses the "ziggurat" algorithm, as described in
"The Ziggurat Method for Generating Random Variables", George Marsaglia and Wai Wan Tsang, Journal of Statistical Software Volume 5, Number 8 (2000), 1-7.
exponential_distribution
public
construct/copy/destruct(RealType lambda = );
Constructs an exponential_distribution
with a given lambda.
Requires: lambda > 0
(const param_type & param);
Constructs an exponential_distribution
from its parameters
exponential_distribution
public member functionsRealType () ;
Returns the lambda parameter of the distribution.
RealType () ;
Returns the smallest value that the distribution can produce.
RealType () ;
Returns the largest value that the distribution can produce.
param_type () ;
Returns the parameters of the distribution.
void (const param_type & param);
Sets the parameters of the distribution.
void ();
Effects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset.
template<typename Engine> result_type (Engine & eng) ;
Returns a random variate distributed according to the exponential distribution.
template<typename Engine> result_type (Engine & eng, const param_type & param) ;
Returns a random variate distributed according to the exponential distribution with parameters specified by param.
exponential_distribution
friend functionstemplate<typename CharT, typename Traits> CharT, Traits > & (CharT, Traits > & os, const exponential_distribution & ed);
Writes the distribution to a std::ostream.
template<typename CharT, typename Traits> CharT, Traits > & (CharT, Traits > & is, const exponential_distribution & ed);
Reads the distribution from a std::istream.
bool (const exponential_distribution & lhs, const exponential_distribution & rhs);
Returns true iff the two distributions will produce identical sequences of values given equal generators.
bool (const exponential_distribution & lhs, const exponential_distribution & rhs);
Returns true iff the two distributions will produce different sequences of values given equal generators.