Skip to main content

Crate ferray_random

Crate ferray_random 

Source
Expand description

§ferray-random

Implements NumPy’s modern Generator/BitGenerator model with pluggable pseudo-random number generators, 30+ continuous and discrete distributions, permutation/sampling operations, and deterministic parallel generation.

§Quick Start

use ferray_random::{default_rng_seeded, Generator};

let mut rng = default_rng_seeded(42);

// Uniform [0, 1)
let values = rng.random(100).unwrap();

// Standard normal
let normals = rng.standard_normal(100).unwrap();

// Integers in [0, 10)
let ints = rng.integers(0, 10, 100).unwrap();

§BitGenerators

Three BitGenerators are provided:

  • Xoshiro256StarStar — default, fast, supports jump-ahead
  • Pcg64 — PCG family, good statistical properties
  • Philox — counter-based, supports stream IDs for parallel generation

§Determinism

All generation is deterministic given the same seed and shape. Parallel generation via standard_normal_parallel produces output identical to sequential generation with the same seed.

Re-exports§

pub use bitgen::BitGenerator;
pub use bitgen::Pcg64;
pub use bitgen::Philox;
pub use bitgen::Xoshiro256StarStar;
pub use generator::Generator;
pub use generator::default_rng;
pub use generator::default_rng_seeded;

Modules§

bitgen
distributions
generator
parallel
permutations