Unless specified otherwise,
the distribution parameters are calculated as:
pk=wk/S 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 IntType = int>
class discrete_distribution {
public:
using result_type = IntType;
using param_type = unspecified;
discrete_distribution();
template<class InputIterator>
discrete_distribution(InputIterator firstW, InputIterator lastW);
discrete_distribution(initializer_list<double> wl);
template<class UnaryOperation>
discrete_distribution(size_t nw, double xmin, double xmax, UnaryOperation fw);
explicit discrete_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<double> probabilities() const;
param_type param() const;
void param(const param_type& parm);
result_type min() const;
result_type max() const;
};