Class AliasTable
Defined in File RandomGenerators.h
Nested Relationships
Nested Types
Class Documentation
-
class AliasTable
the alias method of Walker and Vose: draws i with probability w_i / sum w, in O( 1 ) time from one random word
Public Functions
-
explicit AliasTable(const std::vector<double> &w)
the table of the weights w, not all zero
- Pre:
w not empty, its items finite and >= 0 with a positive sum, and fewer than 2^32 of them
-
inline std::size_t size(void) const
-
explicit AliasTable(const std::vector<double> &w)