The
n+1 distribution parameters
bi,
also known as this distribution's
interval boundaries, shall satisfy the relation
bi<bi+1 for
i=0,…,n−1. Unless specified otherwise,
the remaining
n distribution parameters are calculated as:
ρk=wkS⋅(bk+1−bk) for k=0,…,n−1 ,
in which the values
wk,
commonly known as the
weights, shall be non-negative, non-NaN, and non-infinity
. Moreover, the following relation shall hold:
0<S=w0+⋯+wn−1.
template<class RealType = double>
class piecewise_constant_distribution {
public:
using result_type = RealType;
using param_type = unspecified;
piecewise_constant_distribution();
template<class InputIteratorB, class InputIteratorW>
piecewise_constant_distribution(InputIteratorB firstB, InputIteratorB lastB,
InputIteratorW firstW);
template<class UnaryOperation>
piecewise_constant_distribution(initializer_list<RealType> bl, UnaryOperation fw);
template<class UnaryOperation>
piecewise_constant_distribution(size_t nw, RealType xmin, RealType xmax,
UnaryOperation fw);
explicit piecewise_constant_distribution(const param_type& parm);
void reset();
template<class URBG>
result_type operator()(URBG& g);
template<class URBG>
result_type operator()(URBG& g, const param_type& parm);
vector<result_type> intervals() const;
vector<result_type> densities() const;
param_type param() const;
void param(const param_type& parm);
result_type min() const;
result_type max() const;
};