ferray-random
Random number generation and distributions for the ferray scientific computing library.
What's in this crate
- Generator API:
Generatortype with pluggableBitGeneratorbackends - BitGenerators: Xoshiro256**, PCG64, Philox, MT19937, PCG64DXSM, SFC64
SeedSequence: explicit NumPy-equivalent type for reproducible parallel seeding- 30+ distributions: Normal, Uniform, Exponential, Poisson, Binomial, Gamma, Beta, Chi-squared, Student-t (
student_t/standard_t), Laplace, Weibull, Zipf, noncentral_chisquare, noncentral_f, and more - Permutations:
shuffle,permutation,choice(with/without replacement, weighted) - Parallel generation:
standard_normal_parallelwith Rayon + jump-ahead - Deterministic: All output is reproducible given the same seed
Usage
use ;
let mut rng = default_rng_seeded;
// Uniform [0, 1)
let samples = rng.random.unwrap;
// Standard normal
let normals = rng.standard_normal.unwrap;
// Integers in [0, 10)
let ints = rng.integers.unwrap;
This crate is re-exported through the main ferray crate with the random feature.
License
MIT OR Apache-2.0