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

Instantiations of class template model a . More...

#include <bernoulli_distribution.hpp>

Classes

class  param_type
 

Public Types

typedef int input_type
 
typedef bool result_type
 

Public Member Functions

 bernoulli_distribution (const RealType &p_arg=RealType(0.5))
 Constructs a object. More...
 
 bernoulli_distribution (const param_type &parm)
 Constructs from its parameters. More...
 
RealType p () const
 Returns: The "p" parameter of the distribution. More...
 
bool min BOOST_PREVENT_MACRO_SUBSTITUTION () const
 Returns the smallest value that the distribution can produce. More...
 
bool 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 >
bool operator() (Engine &eng) const
 Returns: a random variate distributed according to the . More...
 
template<class Engine >
bool operator() (Engine &eng, const param_type &parm) const
 Returns: a random variate distributed according to the with parameters specified by param. More...
 
 BOOST_RANDOM_DETAIL_OSTREAM_OPERATOR (os, bernoulli_distribution, bd)
 Writes the parameters of the distribution to a std::ostream. More...
 
 BOOST_RANDOM_DETAIL_ISTREAM_OPERATOR (is, bernoulli_distribution, bd)
 Reads the parameters of the distribution from a std::istream. More...
 
 BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR (bernoulli_distribution, lhs, rhs)
 Returns true iff the two distributions will produce identical sequences of values given equal generators. More...
 

Detailed Description

template<class RealType = double>
class boost::random::bernoulli_distribution< RealType >

Instantiations of class template model a .

Such a random distribution produces bool values distributed with probabilities P(true) = p and P(false) = 1-p. p is the parameter of the distribution.

Member Typedef Documentation

template<class RealType = double>
typedef int boost::random::bernoulli_distribution< RealType >::input_type
template<class RealType = double>
typedef bool boost::random::bernoulli_distribution< RealType >::result_type

Constructor & Destructor Documentation

template<class RealType = double>
boost::random::bernoulli_distribution< RealType >::bernoulli_distribution ( const RealType &  p_arg = RealType(0.5))
inlineexplicit

Constructs a object.

p is the parameter of the distribution.

Requires: 0 <= p <= 1

References BOOST_ASSERT.

Referenced by boost::random::bernoulli_distribution< RealType >::operator()().

template<class RealType = double>
boost::random::bernoulli_distribution< RealType >::bernoulli_distribution ( const param_type parm)
inlineexplicit

Constructs from its parameters.

Member Function Documentation

template<class RealType = double>
bool min boost::random::bernoulli_distribution< RealType >::BOOST_PREVENT_MACRO_SUBSTITUTION ( ) const
inline

Returns the smallest value that the distribution can produce.

template<class RealType = double>
bool max boost::random::bernoulli_distribution< RealType >::BOOST_PREVENT_MACRO_SUBSTITUTION ( ) const
inline

Returns the largest value that the distribution can produce.

template<class RealType = double>
boost::random::bernoulli_distribution< RealType >::BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR ( bernoulli_distribution< RealType >  ,
lhs  ,
rhs   
)
inline

Returns true iff the two distributions will produce identical sequences of values given equal generators.

template<class RealType = double>
boost::random::bernoulli_distribution< RealType >::BOOST_RANDOM_DETAIL_ISTREAM_OPERATOR ( is  ,
bernoulli_distribution< RealType >  ,
bd   
)
inline

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

template<class RealType = double>
boost::random::bernoulli_distribution< RealType >::BOOST_RANDOM_DETAIL_OSTREAM_OPERATOR ( os  ,
bernoulli_distribution< RealType >  ,
bd   
)
inline

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

template<class RealType = double>
template<class Engine >
bool boost::random::bernoulli_distribution< RealType >::operator() ( Engine &  eng) const
inline

Returns: a random variate distributed according to the .

template<class RealType = double>
template<class Engine >
bool boost::random::bernoulli_distribution< RealType >::operator() ( Engine &  eng,
const param_type parm 
) const
inline

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

References boost::random::bernoulli_distribution< RealType >::bernoulli_distribution().

template<class RealType = double>
RealType boost::random::bernoulli_distribution< RealType >::p ( ) const
inline

Returns: The "p" parameter of the distribution.

template<class RealType = double>
param_type boost::random::bernoulli_distribution< RealType >::param ( ) const
inline

Returns the parameters of the distribution.

References boost::random::bernoulli_distribution< RealType >::param_type::param_type().

template<class RealType = double>
void boost::random::bernoulli_distribution< RealType >::param ( const param_type parm)
inline

Sets the parameters of the distribution.

References boost::random::bernoulli_distribution< RealType >::param_type::p().

template<class RealType = double>
void boost::random::bernoulli_distribution< RealType >::reset ( void  )
inline

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


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