ferray_random/lib.rs
1// ferray-random: NumPy-compatible random number generation for Rust
2//
3//! # ferray-random
4//!
5//! Implements NumPy's modern `Generator`/`BitGenerator` model with pluggable
6//! pseudo-random number generators, 30+ continuous and discrete distributions,
7//! permutation/sampling operations, and deterministic parallel generation.
8//!
9//! ## Quick Start
10//!
11//! ```
12//! use ferray_random::{default_rng_seeded, Generator};
13//!
14//! let mut rng = default_rng_seeded(42);
15//!
16//! // Uniform [0, 1)
17//! let values = rng.random(100).unwrap();
18//!
19//! // Standard normal
20//! let normals = rng.standard_normal(100).unwrap();
21//!
22//! // Integers in [0, 10)
23//! let ints = rng.integers(0, 10, 100).unwrap();
24//! ```
25//!
26//! ## BitGenerators
27//!
28//! Three BitGenerators are provided:
29//! - [`Xoshiro256StarStar`](bitgen::Xoshiro256StarStar) — default, fast, supports jump-ahead
30//! - [`Pcg64`](bitgen::Pcg64) — PCG family, good statistical properties
31//! - [`Philox`](bitgen::Philox) — counter-based, supports stream IDs for parallel generation
32//!
33//! ## Determinism
34//!
35//! All generation is deterministic given the same seed and shape. Parallel
36//! generation via [`standard_normal_parallel`](Generator::standard_normal_parallel)
37//! produces output identical to sequential generation with the same seed.
38
39pub mod bitgen;
40pub mod distributions;
41pub mod generator;
42pub mod parallel;
43pub mod permutations;
44
45pub use bitgen::{BitGenerator, Pcg64, Philox, Xoshiro256StarStar};
46pub use generator::{Generator, default_rng, default_rng_seeded};