RavEngine
Loading...
Searching...
No Matches
effolkronium::basic_random_local< Engine, Seeder, IntegerDist, RealDist, BoolDist > Class Template Reference

Base template class for random with local API and local internal member storage. More...

#include <random.hpp>

Public Types

using engine_type = Engine
 Type of used random number engine.
 
using seeder_type = Seeder
 Type of used random number seeder.
 
template<typename T >
using integer_dist_t = IntegerDist< T >
 Type of used integer distribution.
 
template<typename T >
using real_dist_t = RealDist< T >
 Type of used real distribution.
 
using bool_dist_t = BoolDist
 Type of used bool distribution.
 
using common = details::common
 Key type for getting common type numbers or objects.
 

Public Member Functions

void discard (const unsigned long long z)
 Advances the internal state by z times.
 
void reseed ()
 Reseed by Seeder.
 
void seed (const typename Engine::result_type value=Engine::default_seed)
 Reinitializes the internal state of the random-number engine using new seed value.
 
template<typename Sseq >
void seed (Sseq &seq)
 Reinitializes the internal state of the random-number engine using new seed value.
 
Engine::result_type get ()
 return random number from engine in [min(), max()] range
 
bool is_equal (const Engine &other)
 Compares internal pseudo-random number engine with 'other' pseudo-random number engine. Two engines are equal, if their internal states are equivalent, that is, if they would generate equivalent values for any number of calls of operator()
 
template<typename CharT , typename Traits >
void serialize (std::basic_ostream< CharT, Traits > &ost)
 Serializes the internal state of the internal pseudo-random number engine as a sequence of decimal numbers separated by one or more spaces, and inserts it to the stream ost. The fill character and the formatting flags of the stream are ignored and unaffected.
 
template<typename CharT , typename Traits >
void deserialize (std::basic_istream< CharT, Traits > &ist)
 Restores the internal state of the internal pseudo-random number engine from the serialized representation, which was created by an earlier call to 'serialize' using a stream with the same imbued locale and the same CharT and Traits. If the input cannot be deserialized, internal engine is left unchanged and failbit is raised on ist.
 
template<typename T >
std::enable_if< details::is_uniform_int< T >::value, T >::type get (T from=std::numeric_limits< T >::min(), T to=std::numeric_limits< T >::max())
 Generate a random integer number in a [from; to] range by std::uniform_int_distribution.
 
template<typename T >
std::enable_if< details::is_uniform_real< T >::value, T >::type get (T from=std::numeric_limits< T >::min(), T to=std::numeric_limits< T >::max())
 Generate a random real number in a [from; to] range by std::uniform_real_distribution.
 
template<typename T >
std::enable_if< details::is_byte< T >::value, T >::type get (T from=std::numeric_limits< T >::min(), T to=std::numeric_limits< T >::max())
 Generate a random byte number in a [from; to] range.
 
template<typename Key , typename A , typename B , typename C = typename std::common_type<A, B>::type>
std::enable_if< std::is_same< Key, common >::value &&details::is_supported_number< A >::value &&details::is_supported_number< B >::value &&std::is_signed< A >::value!=std::is_unsigned< B >::value, C >::type get (A from=std::numeric_limits< A >::min(), B to=std::numeric_limits< B >::max())
 Generate a random common_type number in a [from; to] range.
 
template<typename T >
std::enable_if< details::is_supported_character< T >::value, T >::type get (T from=std::numeric_limits< T >::min(), T to=std::numeric_limits< T >::max())
 Generate a random character in a [from; to] range by std::uniform_int_distribution.
 
template<typename T >
std::enable_if< std::is_same< T, bool >::value, bool >::type get (const double probability=0.5)
 Generate a bool value with specific probability by std::bernoulli_distribution.
 
template<typename T >
T get (std::initializer_list< T > init_list)
 Return random value from initilizer_list.
 
template<typename InputIt >
std::enable_if< details::is_iterator< InputIt >::value, InputIt >::type get (InputIt first, InputIt last)
 Return random iterator from iterator range.
 
template<typename Container >
auto get (Container &container) -> typename std::enable_if< details::is_iterator< decltype(std::begin(container))>::value, decltype(std::begin(container)) >::type
 Return random iterator from Container.
 
template<template< typename... > class Container, typename A >
std::enable_if< details::has_reserve< Container< A > >::value, Container< A > >::type get (A from, A to, std::size_t size)
 Return container filled with random values.
 
template<template< typename... > class Container, typename Key , typename A , typename B , typename C = typename std::common_type<A, B>::type>
std::enable_if< std::is_same< Key, common >::value &&details::has_reserve< Container< A > >::value, Container< C > >::type get (A start, B end, std::size_t size)
 Return container filled with random common_type values.
 
template<template< typename... > class Container, typename A >
std::enable_if<!details::has_reserve< Container< A > >::value, Container< A > >::type get (A start, A end, std::size_t size)
 Return container filled with random values.
 
template<template< typename... > class Container, typename Key , typename A , typename B , typename C = typename std::common_type<A, B>::type>
std::enable_if< std::is_same< Key, common >::value &&!details::has_reserve< Container< C > >::value, Container< C > >::type get (A start, B end, std::size_t size)
 Return container filled with random common_type values.
 
template<template< typename AA, std::size_t NN, typename... > class Container, std::size_t N, typename A >
std::enable_if<!details::has_insert< Container< A, N > >::value, Container< A, N > >::type get (A start, A end)
 Return array-like container filled with random values.
 
template<template< typename AA, std::size_t NN, typename... > class Container, std::size_t N, typename Key , typename A , typename B , typename C = typename std::common_type<A, B>::type>
std::enable_if< std::is_same< Key, common >::value &&!details::has_insert< Container< C, N > >::value, Container< C, N > >::type get (A start, B end)
 Return array-like container filled with random common_type values.
 
template<typename T , std::size_t N>
T * get (T(&array)[N])
 Return random pointer from built-in array.
 
template<typename Dist , typename... Args>
Dist::result_type get (Args &&... args)
 Return value from custom Dist distribution seeded by internal random engine.
 
template<typename Dist >
Dist::result_type get (Dist &dist)
 Return value from custom 'dist' distribution seeded by internal random engine.
 
template<typename RandomIt >
void shuffle (RandomIt first, RandomIt last)
 Reorders the elements in the given range [first, last) such that each possible permutation of those elements has equal probability of appearance.
 
template<typename Container >
void shuffle (Container &container)
 Reorders the elements in the given container such that each possible permutation of those elements has equal probability of appearance.
 
Engine get_engine () const
 return internal engine by copy
 
Engine & engine ()
 return internal engine by ref
 

Static Public Member Functions

static constexpr Engine::result_type min ()
 
static constexpr Engine::result_type max ()
 

Static Protected Member Functions

static Engine make_seeded_engine ()
 return engine seeded by Seeder
 

Protected Attributes

Engine m_engine { make_seeded_engine( ) }
 The random number engine.
 

Detailed Description

template<typename Engine, typename Seeder = seeder_default, template< typename > class IntegerDist = std::uniform_int_distribution, template< typename > class RealDist = std::uniform_real_distribution, typename BoolDist = std::bernoulli_distribution>
class effolkronium::basic_random_local< Engine, Seeder, IntegerDist, RealDist, BoolDist >

Base template class for random with local API and local internal member storage.

Note
it IS thread safe but less efficient then basic_random_static
Parameters
EngineA random engine with interface like in the std::mt19937
SeederA seeder type which return seed for internal engine through operator()

Member Function Documentation

◆ deserialize()

template<typename Engine , typename Seeder = seeder_default, template< typename > class IntegerDist = std::uniform_int_distribution, template< typename > class RealDist = std::uniform_real_distribution, typename BoolDist = std::bernoulli_distribution>
template<typename CharT , typename Traits >
void effolkronium::basic_random_local< Engine, Seeder, IntegerDist, RealDist, BoolDist >::deserialize ( std::basic_istream< CharT, Traits > &  ist)
inline

Restores the internal state of the internal pseudo-random number engine from the serialized representation, which was created by an earlier call to 'serialize' using a stream with the same imbued locale and the same CharT and Traits. If the input cannot be deserialized, internal engine is left unchanged and failbit is raised on ist.

Parameters
ostThe input stream to extract the data from

◆ get() [1/18]

template<typename Engine , typename Seeder = seeder_default, template< typename > class IntegerDist = std::uniform_int_distribution, template< typename > class RealDist = std::uniform_real_distribution, typename BoolDist = std::bernoulli_distribution>
template<template< typename... > class Container, typename A >
std::enable_if< details::has_reserve< Container< A > >::value, Container< A > >::type effolkronium::basic_random_local< Engine, Seeder, IntegerDist, RealDist, BoolDist >::get ( A  from,
A  to,
std::size_t  size 
)
inline

Return container filled with random values.

Parameters
fromThe first limit number of a random range
toThe second limit number of a random range
sizeThe number of elements in resulting container
Returns
Container filled with random values
Note
Container "reserve" method will be called before generation

◆ get() [2/18]

template<typename Engine , typename Seeder = seeder_default, template< typename > class IntegerDist = std::uniform_int_distribution, template< typename > class RealDist = std::uniform_real_distribution, typename BoolDist = std::bernoulli_distribution>
template<typename Key , typename A , typename B , typename C = typename std::common_type<A, B>::type>
std::enable_if< std::is_same< Key, common >::value &&details::is_supported_number< A >::value &&details::is_supported_number< B >::value &&std::is_signed< A >::value!=std::is_unsigned< B >::value, C >::type effolkronium::basic_random_local< Engine, Seeder, IntegerDist, RealDist, BoolDist >::get ( A  from = std::numeric_limits<A>::min( ),
B  to = std::numeric_limits<B>::max( ) 
)
inline

Generate a random common_type number in a [from; to] range.

Parameters
KeyThe Key type for this version of 'get' method Type should be '(THIS_TYPE)common' struct
fromThe first limit number of a random range
toThe second limit number of a random range
Returns
A random common_type number in a [from; to] range
Note
Allow both: 'from' <= 'to' and 'from' >= 'to'
Allow implicit type conversion
Prevent implicit type conversion from singed to unsigned types Why? std::common_type<Unsigned, Signed> chooses unsigned value, then Signed value will be converted to Unsigned value which gives us a wrong range for random values. https://stackoverflow.com/a/5416498/5734836

◆ get() [3/18]

template<typename Engine , typename Seeder = seeder_default, template< typename > class IntegerDist = std::uniform_int_distribution, template< typename > class RealDist = std::uniform_real_distribution, typename BoolDist = std::bernoulli_distribution>
template<template< typename AA, std::size_t NN, typename... > class Container, std::size_t N, typename A >
std::enable_if<!details::has_insert< Container< A, N > >::value, Container< A, N > >::type effolkronium::basic_random_local< Engine, Seeder, IntegerDist, RealDist, BoolDist >::get ( A  start,
A  end 
)
inline

Return array-like container filled with random values.

Parameters
fromThe first limit number of a random range
toThe second limit number of a random range
NThe number of elements in resulting container
Returns
Container filled with random values

◆ get() [4/18]

template<typename Engine , typename Seeder = seeder_default, template< typename > class IntegerDist = std::uniform_int_distribution, template< typename > class RealDist = std::uniform_real_distribution, typename BoolDist = std::bernoulli_distribution>
template<template< typename... > class Container, typename A >
std::enable_if<!details::has_reserve< Container< A > >::value, Container< A > >::type effolkronium::basic_random_local< Engine, Seeder, IntegerDist, RealDist, BoolDist >::get ( A  start,
A  end,
std::size_t  size 
)
inline

Return container filled with random values.

Parameters
fromThe first limit number of a random range
toThe second limit number of a random range
sizeThe number of elements in resulting container
Returns
Container filled with random values

◆ get() [5/18]

template<typename Engine , typename Seeder = seeder_default, template< typename > class IntegerDist = std::uniform_int_distribution, template< typename > class RealDist = std::uniform_real_distribution, typename BoolDist = std::bernoulli_distribution>
template<template< typename AA, std::size_t NN, typename... > class Container, std::size_t N, typename Key , typename A , typename B , typename C = typename std::common_type<A, B>::type>
std::enable_if< std::is_same< Key, common >::value &&!details::has_insert< Container< C, N > >::value, Container< C, N > >::type effolkronium::basic_random_local< Engine, Seeder, IntegerDist, RealDist, BoolDist >::get ( A  start,
B  end 
)
inline

Return array-like container filled with random common_type values.

Parameters
KeyThe Key type for this version of 'get' method Type should be '(THIS_TYPE)common' struct
fromThe first limit number of a random range
toThe second limit number of a random range
sizeThe number of elements in resulting container
Returns
Container filled with random values

◆ get() [6/18]

template<typename Engine , typename Seeder = seeder_default, template< typename > class IntegerDist = std::uniform_int_distribution, template< typename > class RealDist = std::uniform_real_distribution, typename BoolDist = std::bernoulli_distribution>
template<template< typename... > class Container, typename Key , typename A , typename B , typename C = typename std::common_type<A, B>::type>
std::enable_if< std::is_same< Key, common >::value &&details::has_reserve< Container< A > >::value, Container< C > >::type effolkronium::basic_random_local< Engine, Seeder, IntegerDist, RealDist, BoolDist >::get ( A  start,
B  end,
std::size_t  size 
)
inline

Return container filled with random common_type values.

Parameters
KeyThe Key type for this version of 'get' method Type should be '(THIS_TYPE)common' struct
fromThe first limit number of a random range
toThe second limit number of a random range
sizeThe number of elements in resulting container
Returns
Container filled with random values
Note
Container "reserve" method will be called before generation

◆ get() [7/18]

template<typename Engine , typename Seeder = seeder_default, template< typename > class IntegerDist = std::uniform_int_distribution, template< typename > class RealDist = std::uniform_real_distribution, typename BoolDist = std::bernoulli_distribution>
template<template< typename... > class Container, typename Key , typename A , typename B , typename C = typename std::common_type<A, B>::type>
std::enable_if< std::is_same< Key, common >::value &&!details::has_reserve< Container< C > >::value, Container< C > >::type effolkronium::basic_random_local< Engine, Seeder, IntegerDist, RealDist, BoolDist >::get ( A  start,
B  end,
std::size_t  size 
)
inline

Return container filled with random common_type values.

Parameters
KeyThe Key type for this version of 'get' method Type should be '(THIS_TYPE)common' struct
fromThe first limit number of a random range
toThe second limit number of a random range
sizeThe number of elements in resulting container
Returns
Container filled with random values

◆ get() [8/18]

template<typename Engine , typename Seeder = seeder_default, template< typename > class IntegerDist = std::uniform_int_distribution, template< typename > class RealDist = std::uniform_real_distribution, typename BoolDist = std::bernoulli_distribution>
template<typename Dist , typename... Args>
Dist::result_type effolkronium::basic_random_local< Engine, Seeder, IntegerDist, RealDist, BoolDist >::get ( Args &&...  args)
inline

Return value from custom Dist distribution seeded by internal random engine.

Parameters
DistThe type of custom distribution with next concept: http://en.cppreference.com/w/cpp/concept/RandomNumberDistribution
argsThe arguments which will be forwarded to Dist constructor
Returns
Value from custom distribution

◆ get() [9/18]

template<typename Engine , typename Seeder = seeder_default, template< typename > class IntegerDist = std::uniform_int_distribution, template< typename > class RealDist = std::uniform_real_distribution, typename BoolDist = std::bernoulli_distribution>
template<typename T >
std::enable_if< std::is_same< T, bool >::value, bool >::type effolkronium::basic_random_local< Engine, Seeder, IntegerDist, RealDist, BoolDist >::get ( const double  probability = 0.5)
inline

Generate a bool value with specific probability by std::bernoulli_distribution.

Parameters
probabilityThe probability of generating true in [0; 1] range 0 means always false, 1 means always true
Returns
'true' with 'probability' probability ('false' otherwise)

◆ get() [10/18]

template<typename Engine , typename Seeder = seeder_default, template< typename > class IntegerDist = std::uniform_int_distribution, template< typename > class RealDist = std::uniform_real_distribution, typename BoolDist = std::bernoulli_distribution>
template<typename Container >
auto effolkronium::basic_random_local< Engine, Seeder, IntegerDist, RealDist, BoolDist >::get ( Container &  container) -> typename std::enable_if<details::is_iterator< decltype(std::begin(container))>::value , decltype(std::begin(container)) >::type
inline

Return random iterator from Container.

Parameters
containerThe container with elements
Returns
Random iterator from container
Note
If container is empty return std::end( container ) iterator

◆ get() [11/18]

template<typename Engine , typename Seeder = seeder_default, template< typename > class IntegerDist = std::uniform_int_distribution, template< typename > class RealDist = std::uniform_real_distribution, typename BoolDist = std::bernoulli_distribution>
template<typename Dist >
Dist::result_type effolkronium::basic_random_local< Engine, Seeder, IntegerDist, RealDist, BoolDist >::get ( Dist &  dist)
inline

Return value from custom 'dist' distribution seeded by internal random engine.

Parameters
distThe custom distribution with next concept: http://en.cppreference.com/w/cpp/concept/RandomNumberDistribution
argsThe arguments which will be forwarded to Dist constructor
Returns
Value from custom 'dist' distribution

◆ get() [12/18]

template<typename Engine , typename Seeder = seeder_default, template< typename > class IntegerDist = std::uniform_int_distribution, template< typename > class RealDist = std::uniform_real_distribution, typename BoolDist = std::bernoulli_distribution>
template<typename InputIt >
std::enable_if< details::is_iterator< InputIt >::value, InputIt >::type effolkronium::basic_random_local< Engine, Seeder, IntegerDist, RealDist, BoolDist >::get ( InputIt  first,
InputIt  last 
)
inline

Return random iterator from iterator range.

Parameters
first,last- the range of elements
Returns
Random iterator from [first, last) range
Note
If first == last, return last

◆ get() [13/18]

template<typename Engine , typename Seeder = seeder_default, template< typename > class IntegerDist = std::uniform_int_distribution, template< typename > class RealDist = std::uniform_real_distribution, typename BoolDist = std::bernoulli_distribution>
template<typename T >
T effolkronium::basic_random_local< Engine, Seeder, IntegerDist, RealDist, BoolDist >::get ( std::initializer_list< T >  init_list)
inline

Return random value from initilizer_list.

Parameters
init_listinitilizer_list with values
Returns
Random value from initilizer_list
Note
Should be 1 or more elements in initilizer_list
Warning! Elements in initilizer_list can't be moved: https://stackoverflow.com/a/8193157/5734836

◆ get() [14/18]

template<typename Engine , typename Seeder = seeder_default, template< typename > class IntegerDist = std::uniform_int_distribution, template< typename > class RealDist = std::uniform_real_distribution, typename BoolDist = std::bernoulli_distribution>
template<typename T >
std::enable_if< details::is_uniform_int< T >::value, T >::type effolkronium::basic_random_local< Engine, Seeder, IntegerDist, RealDist, BoolDist >::get ( T  from = std::numeric_limits<T>::min( ),
T  to = std::numeric_limits<T>::max( ) 
)
inline

Generate a random integer number in a [from; to] range by std::uniform_int_distribution.

Parameters
fromThe first limit number of a random range
toThe second limit number of a random range
Returns
A random integer number in a [from; to] range
Note
Allow both: 'from' <= 'to' and 'from' >= 'to'
Prevent implicit type conversion

◆ get() [15/18]

template<typename Engine , typename Seeder = seeder_default, template< typename > class IntegerDist = std::uniform_int_distribution, template< typename > class RealDist = std::uniform_real_distribution, typename BoolDist = std::bernoulli_distribution>
template<typename T >
std::enable_if< details::is_uniform_real< T >::value, T >::type effolkronium::basic_random_local< Engine, Seeder, IntegerDist, RealDist, BoolDist >::get ( T  from = std::numeric_limits<T>::min( ),
T  to = std::numeric_limits<T>::max( ) 
)
inline

Generate a random real number in a [from; to] range by std::uniform_real_distribution.

Parameters
fromThe first limit number of a random range
toThe second limit number of a random range
Returns
A random real number in a [from; to] range
Note
Allow both: 'from' <= 'to' and 'from' >= 'to'
Prevent implicit type conversion

◆ get() [16/18]

template<typename Engine , typename Seeder = seeder_default, template< typename > class IntegerDist = std::uniform_int_distribution, template< typename > class RealDist = std::uniform_real_distribution, typename BoolDist = std::bernoulli_distribution>
template<typename T >
std::enable_if< details::is_byte< T >::value, T >::type effolkronium::basic_random_local< Engine, Seeder, IntegerDist, RealDist, BoolDist >::get ( T  from = std::numeric_limits<T>::min( ),
T  to = std::numeric_limits<T>::max( ) 
)
inline

Generate a random byte number in a [from; to] range.

Parameters
fromThe first limit number of a random range
toThe second limit number of a random range
Returns
A random byte number in a [from; to] range
Note
Allow both: 'from' <= 'to' and 'from' >= 'to'
Prevent implicit type conversion

◆ get() [17/18]

template<typename Engine , typename Seeder = seeder_default, template< typename > class IntegerDist = std::uniform_int_distribution, template< typename > class RealDist = std::uniform_real_distribution, typename BoolDist = std::bernoulli_distribution>
template<typename T >
std::enable_if< details::is_supported_character< T >::value, T >::type effolkronium::basic_random_local< Engine, Seeder, IntegerDist, RealDist, BoolDist >::get ( T  from = std::numeric_limits<T>::min(),
T  to = std::numeric_limits<T>::max() 
)
inline

Generate a random character in a [from; to] range by std::uniform_int_distribution.

Parameters
fromThe first limit number of a random range
toThe second limit number of a random range
Returns
A random character in a [from; to] range
Note
Allow both: 'from' <= 'to' and 'from' >= 'to'
Prevent implicit type conversion

◆ get() [18/18]

template<typename Engine , typename Seeder = seeder_default, template< typename > class IntegerDist = std::uniform_int_distribution, template< typename > class RealDist = std::uniform_real_distribution, typename BoolDist = std::bernoulli_distribution>
template<typename T , std::size_t N>
T * effolkronium::basic_random_local< Engine, Seeder, IntegerDist, RealDist, BoolDist >::get ( T(&)  array[N])
inline

Return random pointer from built-in array.

Parameters
arrayThe built-in array with elements
Returns
Pointer to random element in array

◆ is_equal()

template<typename Engine , typename Seeder = seeder_default, template< typename > class IntegerDist = std::uniform_int_distribution, template< typename > class RealDist = std::uniform_real_distribution, typename BoolDist = std::bernoulli_distribution>
bool effolkronium::basic_random_local< Engine, Seeder, IntegerDist, RealDist, BoolDist >::is_equal ( const Engine &  other)
inline

Compares internal pseudo-random number engine with 'other' pseudo-random number engine. Two engines are equal, if their internal states are equivalent, that is, if they would generate equivalent values for any number of calls of operator()

Parameters
otherThe engine, with which the internal engine will be compared
Returns
true, if other and internal engine are equal

◆ max()

template<typename Engine , typename Seeder = seeder_default, template< typename > class IntegerDist = std::uniform_int_distribution, template< typename > class RealDist = std::uniform_real_distribution, typename BoolDist = std::bernoulli_distribution>
static constexpr Engine::result_type effolkronium::basic_random_local< Engine, Seeder, IntegerDist, RealDist, BoolDist >::max ( )
inlinestaticconstexpr
Returns
The maximum value potentially generated by the random-number engine

◆ min()

template<typename Engine , typename Seeder = seeder_default, template< typename > class IntegerDist = std::uniform_int_distribution, template< typename > class RealDist = std::uniform_real_distribution, typename BoolDist = std::bernoulli_distribution>
static constexpr Engine::result_type effolkronium::basic_random_local< Engine, Seeder, IntegerDist, RealDist, BoolDist >::min ( )
inlinestaticconstexpr
Returns
The minimum value potentially generated by the random-number engine

◆ seed() [1/2]

template<typename Engine , typename Seeder = seeder_default, template< typename > class IntegerDist = std::uniform_int_distribution, template< typename > class RealDist = std::uniform_real_distribution, typename BoolDist = std::bernoulli_distribution>
void effolkronium::basic_random_local< Engine, Seeder, IntegerDist, RealDist, BoolDist >::seed ( const typename Engine::result_type  value = Engine::default_seed)
inline

Reinitializes the internal state of the random-number engine using new seed value.

Parameters
valueThe seed value to use in the initialization of the internal state

◆ seed() [2/2]

template<typename Engine , typename Seeder = seeder_default, template< typename > class IntegerDist = std::uniform_int_distribution, template< typename > class RealDist = std::uniform_real_distribution, typename BoolDist = std::bernoulli_distribution>
template<typename Sseq >
void effolkronium::basic_random_local< Engine, Seeder, IntegerDist, RealDist, BoolDist >::seed ( Sseq &  seq)
inline

Reinitializes the internal state of the random-number engine using new seed value.

Parameters
seqThe seed sequence to use in the initialization of the internal state

◆ serialize()

template<typename Engine , typename Seeder = seeder_default, template< typename > class IntegerDist = std::uniform_int_distribution, template< typename > class RealDist = std::uniform_real_distribution, typename BoolDist = std::bernoulli_distribution>
template<typename CharT , typename Traits >
void effolkronium::basic_random_local< Engine, Seeder, IntegerDist, RealDist, BoolDist >::serialize ( std::basic_ostream< CharT, Traits > &  ost)
inline

Serializes the internal state of the internal pseudo-random number engine as a sequence of decimal numbers separated by one or more spaces, and inserts it to the stream ost. The fill character and the formatting flags of the stream are ignored and unaffected.

Parameters
ostThe output stream to insert the data to

◆ shuffle() [1/2]

template<typename Engine , typename Seeder = seeder_default, template< typename > class IntegerDist = std::uniform_int_distribution, template< typename > class RealDist = std::uniform_real_distribution, typename BoolDist = std::bernoulli_distribution>
template<typename Container >
void effolkronium::basic_random_local< Engine, Seeder, IntegerDist, RealDist, BoolDist >::shuffle ( Container &  container)
inline

Reorders the elements in the given container such that each possible permutation of those elements has equal probability of appearance.

Parameters
container- the container with elements to shuffle randomly

◆ shuffle() [2/2]

template<typename Engine , typename Seeder = seeder_default, template< typename > class IntegerDist = std::uniform_int_distribution, template< typename > class RealDist = std::uniform_real_distribution, typename BoolDist = std::bernoulli_distribution>
template<typename RandomIt >
void effolkronium::basic_random_local< Engine, Seeder, IntegerDist, RealDist, BoolDist >::shuffle ( RandomIt  first,
RandomIt  last 
)
inline

Reorders the elements in the given range [first, last) such that each possible permutation of those elements has equal probability of appearance.

Parameters
first,last- the range of elements to shuffle randomly

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