Implementation of Walker's Alias method.
A high-performance, dependency-free mathematical toolkit for Rust. Includes generic matrices, Quaternions, MCMC, ODE/PDE solvers, Time Series, and more.
Generate cxx compatable `Trivial` bindings for rust enum types
If a categorical distribution has k distinct values, traditional approaches will require O(k) work to pick an outcome with the correct probabilities. This algorithm uses conditional probability to construct a table which will yield outcomes with the correct probabilities. Table generation requires O(k) time, but subsequent generation is done in O(1) time.
Fork of aliastable by Paul J Sanchez. If a categorical distribution has k distinct values, traditional approaches will require O(k) work to pick an outcome with the correct probabilities. This algorithm uses conditional probability to construct a table which will yield outcomes with the correct probabilities, but in O(1) time.