template<typename State>
class quetzal::utils::random::DiscreteDistribution< State >
Sampling (non) arithmetic values in discrete probability distribution.
Produces random State objects, where the probability of each individual State \(i\) is defined as \(w = i/S\), that is the weight of the ith integer divided by the sum of all \(n\) weights.
- Template Parameters
-
State | is the support of the probability distribution. |
|
| DiscreteDistribution ()=default |
| Default constructor.
|
|
| DiscreteDistribution (const param_type &p) |
| Constructor.
|
|
| DiscreteDistribution (DiscreteDistribution< State > const &other)=default |
| Copy constructor.
|
|
| DiscreteDistribution (DiscreteDistribution< State > &&other)=default |
| Move constructor.
|
|
| DiscreteDistribution (std::vector< result_type > const &support, std::vector< double > const &weights) |
| Constructor.
|
|
| DiscreteDistribution (std::vector< result_type > &&support, std::vector< double > &&weights) noexcept |
| Constructor.
|
|
DiscreteDistribution< State > & | operator= (DiscreteDistribution< State > const &other)=default |
| Copy assignment operator.
|
|
DiscreteDistribution< State > & | operator= (DiscreteDistribution< State > &&other)=default |
| Move assignment operator.
|
|
template<typename Generator > |
result_type | operator() (Generator &g) const |
| Generates random objects that are distributed according to the associated parameter set. The entropy is acquired by calling g.operator().
|
|
template<typename Generator > |
result_type | operator() (Generator &g, const param_type ¶ms) const |
| Generates random numbers that are distributed according to params The entropy is acquired by calling g.operator().
|
|