Expand description
§RNG Pack
A collection of random number generators.
This crate provides implementations of various pseudo-random number generators (PRNGs), including:
- Mersenne Twister:
rng32::Mt19937(32-bit),rng64::Mt1993764(64-bit). - Permuted Congruential Generator:
rng32::Pcg32(32-bit output). - Philox:
rng32::Philox32(4x32-bit),rng64::Philox64(2x64-bit). - Twisted Generalized Feedback Shift Register:
rng64::TwistedGFSR(64-bit). - Small Fast Chaotic:
rng64::Sfc64(64-bit). - Xorshift:
rng32::Xorshift32(32-bit),rng64::Xorshift64(64-bit),rng128::Xorshift128(128-bit state). - Xorwow:
rng32::Xorwow(32-bit). - Xoshiro:
rng64::Xoshiro256Pp,rng64::Xoshiro256Ss(64-bit). - Linear Congruential Generator:
rng32::Lcg32(32-bit),rng64::Lcg64(64-bit). - Cellular Automata:
rng64::Cet64(64-bit). - SplitMix:
rng32::SplitMix32(32-bit),rng64::SplitMix64(64-bit).
§Macros
Each generator supports generating uniform random numbers for various types (u32, u64, f32, f64) and ranges.
§C API
This crate also exports C-compatible functions for creating, using, and freeing these generators, allowing them to be used from other languages.
Modules§
- bst
- A weighted random selection structure using a Binary Search Tree (BST) approach.
- macros
- Macros for quick random number generation.
- rng
- A 32/64-bit random number generator trait.
- rng32
- Consolidated 32-bit random number generators.
- rng64
- Consolidated 64-bit random number generators.
- rng128
- Consolidated 128-bit random number generators.
Macros§
- choice
- next
- Generates the next random value using the specified algorithm and output type.
- rand
- Generates a random value in the specified range using the specified algorithm and output type.
- search
- Randomly selects an index based on weights using a binary search approach.
- wrap
- Wraps a value in a
Wrappingtype.