|
| piecewise_constant_distribution () |
| Creates a new piecewise_constant_distribution with a single interval, [0, 1). More...
|
|
template<class IntervalIter , class WeightIter > |
| piecewise_constant_distribution (IntervalIter first_interval, IntervalIter last_interval, WeightIter first_weight) |
| Constructs a piecewise_constant_distribution from two iterator ranges containing the interval boundaries and the interval weights. More...
|
|
template<class T , class F > |
| piecewise_constant_distribution (std::initializer_list< T > il, F f) |
| Constructs a piecewise_constant_distribution from an initializer_list containing the interval boundaries and a unary function specifying the weights. More...
|
|
template<class IntervalsRange , class WeightsRange > |
| piecewise_constant_distribution (const IntervalsRange &intervals_arg, const WeightsRange &weights_arg) |
| Constructs a piecewise_constant_distribution from Boost.Range ranges holding the interval boundaries and the weights. More...
|
|
template<class F > |
| piecewise_constant_distribution (std::size_t nw, RealType xmin, RealType xmax, F f) |
| Constructs a piecewise_constant_distribution that approximates a function. More...
|
|
| piecewise_constant_distribution (const param_type &parm) |
| Constructs a piecewise_constant_distribution from its parameters. More...
|
|
template<class URNG > |
RealType | operator() (URNG &urng) const |
| Returns a value distributed according to the parameters of the piecewist_constant_distribution. More...
|
|
template<class URNG > |
RealType | operator() (URNG &urng, const param_type &parm) const |
| Returns a value distributed according to the parameters specified by param. More...
|
|
result_type min | BOOST_PREVENT_MACRO_SUBSTITUTION () const |
| Returns the smallest value that the distribution can produce. More...
|
|
result_type max | BOOST_PREVENT_MACRO_SUBSTITUTION () const |
| Returns the largest value that the distribution can produce. More...
|
|
std::vector< RealType > | densities () const |
| Returns a vector containing the probability density over each interval. More...
|
|
std::vector< RealType > | intervals () const |
| Returns a vector containing the interval boundaries. 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...
|
|
| BOOST_RANDOM_DETAIL_OSTREAM_OPERATOR (os, piecewise_constant_distribution, pcd) |
| Writes a distribution to a std::ostream . More...
|
|
| BOOST_RANDOM_DETAIL_ISTREAM_OPERATOR (is, piecewise_constant_distribution, pcd) |
| Reads a distribution from a std::istream . More...
|
|
| BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR (piecewise_constant_distribution, lhs, rhs) |
| Returns true if the two distributions will return the same sequence of values, when passed equal generators. More...
|
|
template<class RealType = double, class WeightType = double>
class boost::random::piecewise_constant_distribution< RealType, WeightType >
The class piecewise_constant_distribution
models a .
template<class RealType = double, class WeightType = double>
template<class IntervalIter , class WeightIter >
Constructs a piecewise_constant_distribution from two iterator ranges containing the interval boundaries and the interval weights.
If there are less than two boundaries, then this is equivalent to the default constructor and creates a single interval, [0, 1).
The values of the interval boundaries must be strictly increasing, and the number of weights must be one less than the number of interval boundaries. If there are extra weights, they are ignored.
For example,
double weights[] = { 1.0, 1.0 };
piecewise_constant_distribution<> dist(
&intervals[0], &intervals[0] + 3, &weights[0]);
The distribution has a 50% chance of producing a value between 0 and 1 and a 50% chance of producing a value between 1 and 4.
References boost::multiprecision::backends::i.
template<class RealType = double, class WeightType = double>
template<class T , class F >
Constructs a piecewise_constant_distribution from an initializer_list containing the interval boundaries and a unary function specifying the weights.
Each weight is determined by calling the function at the midpoint of the corresponding interval.
If the initializer_list contains less 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::multiprecision::backends::i.
template<class RealType = double, class WeightType = double>
template<class IntervalsRange , class WeightsRange >
Constructs a piecewise_constant_distribution from Boost.Range ranges holding the interval boundaries and the weights.
If there are less 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 one less than the number of interval boundaries.