LLVM
8.0.1
|
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. More...
#include "llvm/FuzzMutate/Random.h"
Public Member Functions | |
ReservoirSampler (GenT &RandGen) | |
uint64_t | totalWeight () const |
bool | isEmpty () const |
const T & | getSelection () const |
operator bool () const | |
const T & | operator* () const |
template<typename RangeT > | |
ReservoirSampler & | sample (RangeT &&Items) |
Sample each item in Items with unit weight. More... | |
ReservoirSampler & | sample (const T &Item, uint64_t Weight) |
Sample a single item with the given weight. More... | |
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.
|
inline |
|
inline |
Definition at line 45 of file Random.h.
References assert(), and llvm::ReservoirSampler< T, GenT >::isEmpty().
Referenced by llvm::ReservoirSampler< T, GenT >::operator*().
|
inline |
Definition at line 43 of file Random.h.
Referenced by llvm::ReservoirSampler< T, GenT >::getSelection(), and llvm::ReservoirSampler< T, GenT >::operator bool().
|
inlineexplicit |
Definition at line 50 of file Random.h.
References llvm::ReservoirSampler< T, GenT >::isEmpty().
|
inline |
Definition at line 51 of file Random.h.
References llvm::ReservoirSampler< T, GenT >::getSelection().
|
inline |
Sample each item in Items
with unit weight.
Definition at line 54 of file Random.h.
References I.
Referenced by llvm::makeSampler().
|
inline |
Sample a single item with the given weight.
Definition at line 61 of file Random.h.
References llvm::sys::path::begin().
|
inline |