Randomly selects an item by sampling into a set with an unknown number of elements, which may each be weighted to be more likely choices.
Declared in <llvm/FuzzMutate/Random.h>
template<
typename T,
typename GenT>
class ReservoirSampler;
| Name | Description |
|---|---|
ReservoirSampler [constructor] | Construct a sampler that draws randomness from RandGen. |
getSelection | Return the currently selected item. |
isEmpty | Return true if no items have been sampled yet. |
operator* | Return the currently selected item. |
sample | sample overloads |
totalWeight | Return the total weight of all items sampled so far. |
operator bool | Return true if a selection has been made. |
| Name | Description |
|---|---|
makeSampler | Create an empty reservoir sampler over values of type T. |
makeSampler | Create a reservoir sampler and sample all items in Items with unit weight. |
makeSampler | Create a reservoir sampler and sample a single weighted item. |