An instantiation of the class template geometric_distribution
models a .
More...
#include <geometric_distribution.hpp>
Classes | |
class | param_type |
Public Types | |
typedef RealType | input_type |
typedef IntType | result_type |
Public Member Functions | |
geometric_distribution (const RealType &p_arg=RealType(0.5)) | |
Contructs a new geometric_distribution with the paramter p . More... | |
geometric_distribution (const param_type &parm) | |
Constructs a new geometric_distribution from its parameters. More... | |
RealType | p () const |
Returns: the distribution parameter p . 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 the 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... | |
template<class Engine > | |
result_type | operator() (Engine &eng) const |
Returns a random variate distributed according to the geometric_distribution. More... | |
template<class Engine > | |
result_type | operator() (Engine &eng, const param_type &parm) const |
Returns a random variate distributed according to the geometric distribution with parameters specified by param. More... | |
BOOST_RANDOM_DETAIL_OSTREAM_OPERATOR (os, geometric_distribution, gd) | |
Writes the distribution to a std::ostream . More... | |
BOOST_RANDOM_DETAIL_ISTREAM_OPERATOR (is, geometric_distribution, gd) | |
Reads the distribution from a std::istream . More... | |
BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR (geometric_distribution, lhs, rhs) | |
Returns true if the two distributions will produce identical sequences of values given equal generators. More... | |
An instantiation of the class template geometric_distribution
models a .
The distribution produces positive integers which are the number of bernoulli trials with probability p
required to get one that fails.
For the geometric distribution, .
This distribution has been updated to match the C++ standard. Its behavior has changed from the original boost::geometric_distribution. A backwards compatible wrapper is provided in namespace boost.
typedef RealType boost::random::geometric_distribution< IntType, RealType >::input_type |
typedef IntType boost::random::geometric_distribution< IntType, RealType >::result_type |
|
inlineexplicit |
Contructs a new geometric_distribution with the paramter p
.
Requires: 0 < p < 1
References BOOST_ASSERT, and boost::unit_test::framework::init().
Referenced by boost::random::geometric_distribution< IntType, RealType >::operator()().
|
inlineexplicit |
Constructs a new geometric_distribution from its parameters.
References boost::unit_test::framework::init().
|
inline |
Returns the smallest value that the distribution can produce.
|
inline |
Returns the largest value that the distribution can produce.
References boost::accumulators::extract::max.
|
inline |
Returns true if the two distributions will produce identical sequences of values given equal generators.
|
inline |
Reads the distribution from a std::istream
.
|
inline |
Writes the distribution to a std::ostream
.
|
inline |
Returns a random variate distributed according to the geometric_distribution.
References boost::chrono::floor(), boost::math::ef::log(), and boost::flyweights::x.
|
inline |
Returns a random variate distributed according to the geometric distribution with parameters specified by param.
References boost::random::geometric_distribution< IntType, RealType >::geometric_distribution().
|
inline |
Returns: the distribution parameter p
.
|
inline |
Returns the parameters of the distribution.
References boost::random::geometric_distribution< IntType, RealType >::param_type::param_type().
|
inline |
Sets the parameters of the distribution.
References boost::unit_test::framework::init(), and boost::random::geometric_distribution< IntType, RealType >::param_type::p().
|
inline |
Effects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset.