absl::discrete_distribution::discrete_distribution

Constructs a distribution by sampling a weight function.

Synopsis

Declared in <absl/random/discrete_distribution.h>

template<class UnaryOperation>
explicit
discrete_distribution(
    size_t nw,
    double xmin,
    double xmax,
    UnaryOperation fw);

Parameters

NameDescription
nwThe number of weights to generate.
xminThe lower bound of the sampled interval.
xmaxThe upper bound of the sampled interval.
fwThe unary weight function to sample.