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

#include <piecewise_linear_distribution.hpp>

Public Types

typedef
piecewise_linear_distribution 
distribution_type
 

Public Member Functions

 param_type ()
 Constructs a param_type object, representing a distribution that produces values uniformly distributed in the range [0, 1). More...
 
template<class IntervalIter , class WeightIter >
 param_type (IntervalIter intervals_first, IntervalIter intervals_last, WeightIter weight_first)
 Constructs a param_type object from two iterator ranges containing the interval boundaries and weights at the boundaries. More...
 
template<class T , class F >
 param_type (const std::initializer_list< T > &il, F f)
 Constructs a param_type object from an initializer_list containing the interval boundaries and a unary function specifying the weights at the boundaries. More...
 
template<class IntervalRange , class WeightRange >
 param_type (const IntervalRange &intervals_arg, const WeightRange &weights_arg)
 Constructs a param_type object from Boost.Range ranges holding the interval boundaries and the weights at the boundaries. More...
 
template<class F >
 param_type (std::size_t nw, RealType xmin, RealType xmax, F f)
 Constructs the parameters for a distribution that approximates a function. More...
 
std::vector< RealType > intervals () const
 Returns a vector containing the interval boundaries. More...
 
std::vector< RealType > densities () const
 Returns a vector containing the probability densities at all the interval boundaries. 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...
 

Friends

class piecewise_linear_distribution
 Returns true if the two sets of parameters are different. More...
 

Member Typedef Documentation

Constructor & Destructor Documentation

template<class RealType = double>
boost::random::piecewise_linear_distribution< RealType >::param_type::param_type ( )
inline

Constructs a param_type object, representing a distribution that produces values uniformly distributed in the range [0, 1).

Referenced by boost::random::piecewise_linear_distribution< RealType >::param().

template<class RealType = double>
template<class IntervalIter , class WeightIter >
boost::random::piecewise_linear_distribution< RealType >::param_type::param_type ( IntervalIter  intervals_first,
IntervalIter  intervals_last,
WeightIter  weight_first 
)
inline

Constructs a param_type object from two iterator ranges containing the interval boundaries and weights at the boundaries.

If there are fewer than two boundaries, then this is equivalent to the default constructor and the distribution will produce values uniformly distributed in the range [0, 1).

The values of the interval boundaries must be strictly increasing, and the number of weights must be the same as the number of interval boundaries. If there are extra weights, they are ignored.

References boost::multiprecision::backends::i.

template<class RealType = double>
template<class T , class F >
boost::random::piecewise_linear_distribution< RealType >::param_type::param_type ( const std::initializer_list< T > &  il,
f 
)
inline

Constructs a param_type object from an initializer_list containing the interval boundaries and a unary function specifying the weights at the boundaries.

Each weight is determined by calling the function at the corresponding point.

If the initializer_list contains fewer than two elements, this is equivalent to the default constructor and the distribution will produce values uniformly distributed in the range [0, 1).

References boost::end.

template<class RealType = double>
template<class IntervalRange , class WeightRange >
boost::random::piecewise_linear_distribution< RealType >::param_type::param_type ( const IntervalRange &  intervals_arg,
const WeightRange &  weights_arg 
)
inline

Constructs a param_type object from Boost.Range ranges holding the interval boundaries and the weights at the boundaries.

If there are fewer than two interval boundaries, this is equivalent to the default constructor and the distribution will produce values uniformly distributed in the range [0, 1). The number of weights must be equal to the number of interval boundaries.

template<class RealType = double>
template<class F >
boost::random::piecewise_linear_distribution< RealType >::param_type::param_type ( std::size_t  nw,
RealType  xmin,
RealType  xmax,
f 
)
inline

Constructs the parameters for a distribution that approximates a function.

The range of the distribution is [xmin, xmax). This range is divided into nw equally sized intervals and the weights are found by calling the unary function f on the boundaries of the intervals.

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

Member Function Documentation

template<class RealType = double>
boost::random::piecewise_linear_distribution< RealType >::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 RealType = double>
boost::random::piecewise_linear_distribution< RealType >::param_type::BOOST_RANDOM_DETAIL_ISTREAM_OPERATOR ( is  ,
param_type  ,
parm   
)
inline

Reads the parameters from a std::istream.

template<class RealType = double>
boost::random::piecewise_linear_distribution< RealType >::param_type::BOOST_RANDOM_DETAIL_OSTREAM_OPERATOR ( os  ,
param_type  ,
parm   
)
inline

Writes the parameters to a std::ostream.

template<class RealType = double>
std::vector<RealType> boost::random::piecewise_linear_distribution< RealType >::param_type::densities ( ) const
inline

Returns a vector containing the probability densities at all the interval boundaries.

References boost::end, boost::multiprecision::backends::i, boost::accumulators::extract::sum, and boost::multiprecision::width().

template<class RealType = double>
std::vector<RealType> boost::random::piecewise_linear_distribution< RealType >::param_type::intervals ( ) const
inline

Returns a vector containing the interval boundaries.

Friends And Related Function Documentation

template<class RealType = double>
friend class piecewise_linear_distribution
friend

Returns true if the two sets of parameters are different.

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


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