![]() |
fpmas 1.6
|
#include <distribution.h>
Public Member Functions | |
template<typename Container > | |
DiscreteDistribution (const Container &c) | |
![]() | |
Distribution (Args... args) | |
result_type | operator() (Generator_t &generator) |
result_type | min () const override |
result_type | max () const override |
virtual Distribution_t::result_type | min () const=0 |
virtual Distribution_t::result_type | max () const=0 |
Additional Inherited Members | |
![]() | |
typedef Distribution_t::result_type | result_type |
Predefined DiscreteDistribution.
The purpose of the discrete distribution is to select an integer i
in the range [0, n)
such as P(i) = w_i / N
, with w_i
the weight associated to i
and N
the total wheights sum.
The weight list can be provided to the constructor as a container (std::vector, std::list...) of as a pair of begin(), end()
iterators.
|
inline |
Constructs a DiscreteDistribution from weights contained in the specified container.
c | weights list |