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

#include <discrete_distribution.hpp>

Public Types

typedef discrete_distribution distribution_type
 

Public Member Functions

 param_type ()
 Constructs a param_type object, representing a distribution with $p(0) = 1$ and $p(k|k>0) = 0$. More...
 
template<class Iter >
 param_type (Iter first, Iter last)
 If first == last, equivalent to the default constructor. More...
 
 param_type (const std::initializer_list< WeightType > &wl)
 If wl.size() == 0, equivalent to the default constructor. More...
 
template<class Range >
 param_type (const Range &range)
 If the range is empty, equivalent to the default constructor. More...
 
template<class Func >
 param_type (std::size_t nw, double xmin, double xmax, Func fw)
 If nw is zero, equivalent to the default constructor. More...
 
std::vector< WeightType > probabilities () const
 Returns a vector containing the probabilities of each possible value of the distribution. More...
 
 BOOST_RANDOM_DETAIL_OSTREAM_OPERATOR (os, param_type, parm)
 Writes the parameters to a std::ostream. More...
 
 BOOST_RANDOM_DETAIL_ISTREAM_OPERATOR (is, param_type, parm)
 Reads the parameters from a std::istream. More...
 
 BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR (param_type, lhs, rhs)
 Returns true if the two sets of parameters are the same. More...
 

Member Typedef Documentation

template<class IntType = int, class WeightType = double>
typedef discrete_distribution boost::random::discrete_distribution< IntType, WeightType >::param_type::distribution_type

Constructor & Destructor Documentation

template<class IntType = int, class WeightType = double>
boost::random::discrete_distribution< IntType, WeightType >::param_type::param_type ( )
inline

Constructs a param_type object, representing a distribution with $p(0) = 1$ and $p(k|k>0) = 0$.

template<class IntType = int, class WeightType = double>
template<class Iter >
boost::random::discrete_distribution< IntType, WeightType >::param_type::param_type ( Iter  first,
Iter  last 
)
inline

If first == last, equivalent to the default constructor.

Otherwise, the values of the range represent weights for the possible values of the distribution.

References boost::locale::normalize().

template<class IntType = int, class WeightType = double>
boost::random::discrete_distribution< IntType, WeightType >::param_type::param_type ( const std::initializer_list< WeightType > &  wl)
inline

If wl.size() == 0, equivalent to the default constructor.

Otherwise, the values of the initializer_list represent weights for the possible values of the distribution.

References boost::locale::normalize().

template<class IntType = int, class WeightType = double>
template<class Range >
boost::random::discrete_distribution< IntType, WeightType >::param_type::param_type ( const Range &  range)
inlineexplicit

If the range is empty, equivalent to the default constructor.

Otherwise, the elements of the range represent weights for the possible values of the distribution.

References boost::locale::normalize().

template<class IntType = int, class WeightType = double>
template<class Func >
boost::random::discrete_distribution< IntType, WeightType >::param_type::param_type ( std::size_t  nw,
double  xmin,
double  xmax,
Func  fw 
)
inline

If nw is zero, equivalent to the default constructor.

Otherwise, the range of the distribution is [0, nw), and the weights are found by calling fw with values evenly distributed between $\mbox{xmin} + \delta/2$ and $\mbox{xmax} - \delta/2$, where $\delta = (\mbox{xmax} - \mbox{xmin})/\mbox{nw}$.

References BOOST_ASSERT, boost::polygon::delta(), boost::n, and boost::locale::normalize().

Member Function Documentation

template<class IntType = int, class WeightType = double>
boost::random::discrete_distribution< IntType, WeightType >::param_type::BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR ( param_type  ,
lhs  ,
rhs   
)
inline

Returns true if the two sets of parameters are the same.

template<class IntType = int, class WeightType = double>
boost::random::discrete_distribution< IntType, WeightType >::param_type::BOOST_RANDOM_DETAIL_ISTREAM_OPERATOR ( is  ,
param_type  ,
parm   
)
inline

Reads the parameters from a std::istream.

template<class IntType = int, class WeightType = double>
boost::random::discrete_distribution< IntType, WeightType >::param_type::BOOST_RANDOM_DETAIL_OSTREAM_OPERATOR ( os  ,
param_type  ,
parm   
)
inline

Writes the parameters to a std::ostream.

template<class IntType = int, class WeightType = double>
std::vector<WeightType> boost::random::discrete_distribution< IntType, WeightType >::param_type::probabilities ( ) const
inline

Returns a vector containing the probabilities of each possible value of the distribution.


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