Constructors
Declared in <absl/random/discrete_distribution.h>
Constructs a distribution with a single, certain outcome.
discrete_distribution();
» more...
Constructs a distribution from a list of weights.
explicit
discrete_distribution(std::initializer_list<double> weights);
» more...
Constructs a distribution from the given parameter set.
explicit
discrete_distribution(param_type const& p);
» more...
Constructs a distribution from a range of weights.
template<typename InputIterator>
explicit
discrete_distribution(
InputIterator begin,
InputIterator end);
» more...
Constructs a distribution by sampling a weight function.
template<class UnaryOperation>
explicit
discrete_distribution(
size_t nw,
double xmin,
double xmax,
UnaryOperation fw);
» more...
| Name | Description |
|---|---|
| weights | The weights of the possible outcomes. |
| p | The parameter set. |
| begin | An iterator to the first weight. |
| end | An iterator past the last weight. |
| nw | The number of weights to generate. |
| xmin | The lower bound of the sampled interval. |
| xmax | The upper bound of the sampled interval. |
| fw | The unary weight function to sample. |