KrisLibrary  1.0.0
Public Member Functions | Public Attributes | List of all members
FastSampler Struct Reference

Samples from a weighted discrete set in O(log(n)) time after an O(n) initialization. More...

#include <FastSampler.h>

Public Member Functions

 FastSampler (const std::vector< double > &probabilities)
 
template<class RNG >
int Sample (RNG &rng) const
 
int Pick (double val) const
 

Public Attributes

std::vector< double > sump
 

Detailed Description

Samples from a weighted discrete set in O(log(n)) time after an O(n) initialization.


The documentation for this struct was generated from the following file: