aliasmethod
Implementation of Walker's Alias method by Rust.
The algorithm is principally useful when you need to random sampling with replacement by O(1)
.
Example
use XorShiftRng;
use AliasTable
let weights = vec!;
let alias_table = new?;
let rng = from_seed;
let n = alias_table.random;
assert!;