num::categorical_sampler¶
Defined in header <stochastic/categorical.hpp>
class categorical_sampler;
Sampler for drawing many indices with probability proportional to weight: \(P(k) = w_k / \sum_j w_j\).
Members¶
| member | description |
|---|---|
categorical_sampler() = default |
|
explicit categorical_sampler(view<const real> weights) |
|
template <std::uniform_random_bit_generator RNG> idx operator()(RNG &rng) |