libdonut  2.3.2
Application framework for cross-platform game development in C++20
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends | List of all members
donut::random::SplitMix64Engine Class Reference

Implementation of the SplitMix64 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 <donut/random.hpp>

Public Types

using result_type = std::uint64_t
 

Public Member Functions

constexpr SplitMix64Engine () noexcept
 
constexpr SplitMix64Engine (result_type value) noexcept
 
constexpr void seed (result_type value=default_seed) noexcept
 
constexpr result_type operator() () noexcept
 
constexpr void discard (unsigned long long z) noexcept
 
constexpr bool operator== (const SplitMix64Engine &other) const noexcept
 

Static Public Member Functions

static constexpr result_type min ()
 
static constexpr result_type max ()
 

Static Public Attributes

static constexpr result_type default_seed = 0
 

Friends

template<typename CharT , typename Traits >
std::basic_ostream< CharT, Traits > & operator<< (std::basic_ostream< CharT, Traits > &stream, const SplitMix64Engine &engine)
 
template<typename CharT , typename Traits >
std::basic_istream< CharT, Traits > & operator>> (std::basic_istream< CharT, Traits > &stream, SplitMix64Engine &engine)
 

Detailed Description

Implementation of the SplitMix64 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 should typically only be used for seeding the Xoroshiro128PlusPlusEngine, which should be preferred for general use.

Warning
This engine does not produce cryptographcially secure randomness and should not be used for such purposes.
See also
Xoroshiro128PlusPlusEngine

Member Typedef Documentation

◆ result_type

Constructor & Destructor Documentation

◆ SplitMix64Engine() [1/2]

constexpr donut::random::SplitMix64Engine::SplitMix64Engine ( )
inlineconstexprnoexcept

◆ SplitMix64Engine() [2/2]

constexpr donut::random::SplitMix64Engine::SplitMix64Engine ( result_type  value)
inlineexplicitconstexprnoexcept

Member Function Documentation

◆ min()

static constexpr result_type donut::random::SplitMix64Engine::min ( )
inlinestaticconstexpr

◆ max()

static constexpr result_type donut::random::SplitMix64Engine::max ( )
inlinestaticconstexpr

◆ seed()

constexpr void donut::random::SplitMix64Engine::seed ( result_type  value = default_seed)
inlineconstexprnoexcept

◆ operator()()

constexpr result_type donut::random::SplitMix64Engine::operator() ( )
inlineconstexprnoexcept

◆ discard()

constexpr void donut::random::SplitMix64Engine::discard ( unsigned long long  z)
inlineconstexprnoexcept

◆ operator==()

constexpr bool donut::random::SplitMix64Engine::operator== ( const SplitMix64Engine other) const
inlineconstexprnoexcept

Friends And Related Function Documentation

◆ operator<<

template<typename CharT , typename Traits >
std::basic_ostream<CharT, Traits>& operator<< ( std::basic_ostream< CharT, Traits > &  stream,
const SplitMix64Engine engine 
)
friend

◆ operator>>

template<typename CharT , typename Traits >
std::basic_istream<CharT, Traits>& operator>> ( std::basic_istream< CharT, Traits > &  stream,
SplitMix64Engine engine 
)
friend

Member Data Documentation

◆ default_seed

constexpr result_type donut::random::SplitMix64Engine::default_seed = 0
staticconstexpr

The documentation for this class was generated from the following file: