High-quality pseudo-random number generator based on xoshiro256**.
More...
#include <MathUtils_Random.hxx>
|
| | RandomGenerator (const uint64_t theSeed=1) |
| | Initialize with a seed value. Uses SplitMix64 to expand a single seed into the full 256-bit state, ensuring good initialization even from poor seeds.
|
| void | SetSeed (const uint64_t theSeed) |
| | Re-seed the generator.
|
| uint64_t | NextInt () |
| | Generate next 64-bit unsigned integer.
|
| double | NextReal () |
| | Generate next double in [0, 1). Uses 53 bits of randomness for full double precision.
|
High-quality pseudo-random number generator based on xoshiro256**.
xoshiro256** is a general-purpose PRNG designed by David Blackman and Sebastiano Vigna. It has:
- 256-bit state (period 2^256 - 1)
- Passes all BigCrush statistical tests
- Very fast on 64-bit hardware
- Equidistributed to 4 dimensions
Suitable for Monte Carlo methods, stochastic optimization, and any application requiring high-quality randomness.
◆ RandomGenerator()
| MathUtils::RandomGenerator::RandomGenerator |
( |
const uint64_t | theSeed = 1 | ) |
|
|
inlineexplicit |
Initialize with a seed value. Uses SplitMix64 to expand a single seed into the full 256-bit state, ensuring good initialization even from poor seeds.
- Parameters
-
| theSeed | seed value (default 1) |
◆ NextInt()
| uint64_t MathUtils::RandomGenerator::NextInt |
( |
| ) |
|
|
inline |
Generate next 64-bit unsigned integer.
- Returns
- pseudo-random value in [0, 2^64)
◆ NextReal()
| double MathUtils::RandomGenerator::NextReal |
( |
| ) |
|
|
inline |
Generate next double in [0, 1). Uses 53 bits of randomness for full double precision.
- Returns
- pseudo-random value in [0, 1)
◆ SetSeed()
| void MathUtils::RandomGenerator::SetSeed |
( |
const uint64_t | theSeed | ) |
|
|
inline |
Re-seed the generator.
- Parameters
-
The documentation for this class was generated from the following file: