Expand description
Random number generation, shuffling, and weighted sampling.
Provides seeded RNG construction, Fisher-Yates shuffle, and weighted random sampling utilities.
§Reproducibility
For reproducible experiments, use create_rng with a fixed seed.
The underlying algorithm (SmallRng) is deterministic for a given seed
on the same platform.
Structs§
- Weighted
Sampler - Pre-computed weighted sampler for O(log n) repeated sampling.
Functions§
- create_
rng - Creates a fast, seeded random number generator.
- shuffle
- Fisher-Yates (Durstenfeld) in-place shuffle.
- shuffled_
indices - Returns a shuffled index permutation of
[0, n). - weighted_
choose - Selects a random index weighted by the given weights.