![]() |
Arene Base
Fundamental Utilities For Safety Critical C++
|
pseudorandom number generator implementing the xoshiro256++ algorithm More...
Public Types | |
| using | result_type = std::uint64_t |
| prng result type | |
| using | seed_type = std::uint64_t |
| seed argument type | |
Public Member Functions | |
| constexpr | prng_xoshiro () noexcept |
| construct the generator with a seed of zero | |
| constexpr | prng_xoshiro (seed_type initial_seed) noexcept |
| construct the generator with an explicit seed | |
| constexpr auto | operator() () noexcept -> result_type |
| generate the next pseudorandom value and advance the internal state | |
Static Public Member Functions | |
| static constexpr auto | max () noexcept -> result_type |
largest value that operator() can return | |
| static constexpr auto | min () noexcept -> result_type |
smallest value that operator() can return | |
pseudorandom number generator implementing the xoshiro256++ algorithm
xoshiro256++ is a general-purpose PRNG designed by David Blackman and Sebastiano Vigna. It offers sub-nanosecond speed, a 256-bit state space large enough for parallel applications, and passes all known statistical test suites.
The generator satisfies the C++ UniformRandomBitGenerator named requirement, so it can be used with standard library distributions and algorithms that accept a URBG.
A single 64-bit seed is expanded into the full 256-bit internal state using the SplitMix64 generator, as recommended by the xoshiro authors. This ensures the state is never all-zero (the only disallowed state) for any seed value.
prng result type
seed argument type
|
inlineexplicitconstexprnoexcept |
construct the generator with an explicit seed
| initial_seed | initial seed value |
|
inlineconstexprnoexcept |
construct the generator with a seed of zero
|
inlinestaticconstexprnoexcept |
largest value that operator() can return
|
inlinestaticconstexprnoexcept |
smallest value that operator() can return
|
inlineconstexprnoexcept |
generate the next pseudorandom value and advance the internal state