Implementation of the xoroshiro128++ pseudorandom number generator that provides the API required for a standard uniform random bit generator, so that it can be plugged into any of the random number distributions provided by the standard library.
More...
#include <GREM/core/randomness.hpp>
Implementation of the xoroshiro128++ pseudorandom number generator that provides the API required for a standard uniform random bit generator, so that it can be plugged into any of the random number distributions provided by the standard library.
This engine is small, fast and fairly high quality compared to most of the pseudorandom number generators in the standard library (as of C++20).
- Warning
- This engine does not produce cryptographcially secure randomness and should therefore not be used in situations that require a CSPRNG.
- See also
- https://prng.di.unimi.it/ for more information.
◆ result_type
◆ State
◆ Xoroshiro128PlusPlusEngine() [1/3]
| grem::randomness::Xoroshiro128PlusPlusEngine::Xoroshiro128PlusPlusEngine |
( |
| ) |
|
|
inlineconstexprnoexcept |
◆ Xoroshiro128PlusPlusEngine() [2/3]
| grem::randomness::Xoroshiro128PlusPlusEngine::Xoroshiro128PlusPlusEngine |
( |
result_type | seedValue | ) |
|
|
inlineexplicitconstexprnoexcept |
◆ Xoroshiro128PlusPlusEngine() [3/3]
| grem::randomness::Xoroshiro128PlusPlusEngine::Xoroshiro128PlusPlusEngine |
( |
const State & | state | ) |
|
|
inlineexplicitconstexprnoexcept |
◆ min()
| constexpr result_type grem::randomness::Xoroshiro128PlusPlusEngine::min |
( |
| ) |
|
|
inlinestaticnodiscardconstexpr |
◆ max()
| constexpr result_type grem::randomness::Xoroshiro128PlusPlusEngine::max |
( |
| ) |
|
|
inlinestaticnodiscardconstexpr |
◆ seed()
◆ operator()()
| result_type grem::randomness::Xoroshiro128PlusPlusEngine::operator() |
( |
| ) |
|
|
inlineconstexprnoexcept |
◆ discard()
| void grem::randomness::Xoroshiro128PlusPlusEngine::discard |
( |
unsigned long long | z | ) |
|
|
inlineconstexprnoexcept |
◆ jump()
| void grem::randomness::Xoroshiro128PlusPlusEngine::jump |
( |
| ) |
|
|
inlineconstexprnoexcept |
Advance the internal state 2^64 times.
◆ longJump()
| void grem::randomness::Xoroshiro128PlusPlusEngine::longJump |
( |
| ) |
|
|
inlineconstexprnoexcept |
Advance the internal state 2^96 times.
◆ setState()
| void grem::randomness::Xoroshiro128PlusPlusEngine::setState |
( |
const State & | newState | ) |
|
|
inlineconstexprnoexcept |
Set the value representation of the internal state.
- Parameters
-
| newState | new state of the engine to set the state to. |
- Note
- This function is mainly intended to be used for deserialization.
- See also
- getState()
◆ getState()
| State grem::randomness::Xoroshiro128PlusPlusEngine::getState |
( |
| ) |
const |
|
inlinenodiscardconstexprnoexcept |
Get the value representation of the internal state.
- Returns
- the internal state of the engine.
- Note
- This function is mainly intended to be used for serialization.
- See also
- setState()
◆ operator==()
|
|
inlinenodiscardconstexprnoexcept |
◆ operator<<
template<typename CharT, typename Traits>
| std::basic_ostream< CharT, Traits > & operator<< |
( |
std::basic_ostream< CharT, Traits > & | stream, |
|
|
const Xoroshiro128PlusPlusEngine & | engine ) |
|
friend |
◆ operator>>
template<typename CharT, typename Traits>
| std::basic_istream< CharT, Traits > & operator>> |
( |
std::basic_istream< CharT, Traits > & | stream, |
|
|
Xoroshiro128PlusPlusEngine & | engine ) |
|
friend |
◆ default_seed
The documentation for this class was generated from the following file: