LLVM 20.0.0git
Classes | Namespaces | Functions
Random.h File Reference
#include "llvm/Support/raw_ostream.h"
#include <random>

Go to the source code of this file.

Classes

class  llvm::ReservoirSampler< T, GenT >
 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...
 

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.
 

Functions

template<typename T , typename GenT >
T llvm::uniform (GenT &Gen, T Min, T Max)
 Return a uniformly distributed random value between Min and Max.
 
template<typename T , typename GenT >
T llvm::uniform (GenT &Gen)
 Return a uniformly distributed random value of type T.
 
template<typename GenT , typename RangeT , typename ElT = std::remove_reference_t< decltype(*std::begin(std::declval<RangeT>()))>>
ReservoirSampler< ElT, GenT > llvm::makeSampler (GenT &RandGen, RangeT &&Items)
 
template<typename GenT , typename T >
ReservoirSampler< T, GenT > llvm::makeSampler (GenT &RandGen, const T &Item, uint64_t Weight)
 
template<typename T , typename GenT >
ReservoirSampler< T, GenT > llvm::makeSampler (GenT &RandGen)