Go to the documentation of this file.
32 #ifndef __Engine_dot_hpp_
33 #define __Engine_dot_hpp_
35 #include "../features/compilerfeatures.h"
42 #if R123_USE_CXX11_TYPE_TRAITS
43 #include <type_traits>
67 template<
typename CBRNG>
95 ukey_type x = {{
typename ukey_type::value_type(r)}};
112 v.back() = e.
v.back();
116 v.back() = e.
v.back();
119 #if __cplusplus >= 201103L
124 template <
typename SeedSeq>
126 #
if R123_USE_CXX11_TYPE_TRAITS
127 ,
typename std::enable_if<!std::is_convertible<SeedSeq, result_type>::value>::type* =0
138 template <
typename SeedSeq>
140 #
if R123_USE_CXX11_TYPE_TRAITS
141 ,
typename std::enable_if<!std::is_convertible<SeedSeq, result_type>::value>::type* =0
150 return lhs.
c==rhs.
c && lhs.
v.back() == rhs.
v.back() && lhs.
key == rhs.
key;
153 return lhs.
c!=rhs.
c || lhs.
v.back()!=rhs.
v.back() || lhs.
key!=rhs.
key;
157 return os << be.
c <<
" " << be.
key <<
" " << be.
v.back();
161 is >> be.
c >> be.
key >> be.
v.back();
185 return b(
c.incr(),
key)[0];
198 size_t nelem =
c.size();
199 size_t sub = skip % nelem;
226 #if R123_USE_CXX11_TYPE_TRAITS
227 template <
typename DUMMY=
void>
229 typename std::enable_if<!std::is_same<ukey_type, key_type>::value, DUMMY>::type* = 0)
230 :
key(k),
c(){
v.back() = 0; }
232 template <
typename DUMMY=
void>
234 typename std::enable_if<!std::is_same<ukey_type, key_type>::value, DUMMY>::type* = 0){
261 return std::make_pair(
c,
v.back());
266 static const size_t nelem =
c.size();
268 throw std::range_error(
"Engine::setcounter called with elem out of range");
friend bool operator!=(const Engine &lhs, const Engine &rhs)
Definition: Engine.hpp:152
void seed(result_type r)
Definition: Engine.hpp:135
key_type key
Definition: Engine.hpp:77
friend bool operator==(const Engine &lhs, const Engine &rhs)
Definition: Engine.hpp:149
void seed()
Definition: Engine.hpp:146
Definition: Engine.hpp:68
Engine(ukey_type &uk)
Definition: Engine.hpp:218
result_type operator()()
Definition: Engine.hpp:183
key_type getkey() const
Definition: Engine.hpp:245
void discard(R123_ULONG_LONG skip)
Definition: Engine.hpp:196
void seed(const ukey_type &uk)
Definition: Engine.hpp:219
ctr_type c
Definition: Engine.hpp:78
Engine(const Engine &e)
Definition: Engine.hpp:115
Engine(Engine &e)
Definition: Engine.hpp:111
ctr_type v
Definition: Engine.hpp:79
Engine(SeedSeq &s)
Definition: Engine.hpp:125
const static result_type _Max
Definition: Engine.hpp:178
ctr_type::value_type result_type
Definition: Engine.hpp:73
Engine(result_type r)
Definition: Engine.hpp:94
friend std::ostream & operator<<(std::ostream &os, const Engine &be)
Definition: Engine.hpp:156
void fix_invariant()
Definition: Engine.hpp:81
std::pair< ctr_type, result_type > getcounter() const
Definition: Engine.hpp:260
friend std::istream & operator>>(std::istream &is, Engine &be)
Definition: Engine.hpp:160
void seed(SeedSeq &s)
Definition: Engine.hpp:139
void setcounter(const ctr_type &_c, result_type _elem)
Definition: Engine.hpp:265
CBRNG::ctr_type ctr_type
Definition: Engine.hpp:70
static R123_CONSTEXPR result_type min R123_NO_MACRO_SUBST()
Definition: Engine.hpp:180
void seed(ukey_type &uk)
Definition: Engine.hpp:222
CBRNG cbrng_type
Definition: Engine.hpp:69
Engine()
Definition: Engine.hpp:89
ctr_type operator()(const ctr_type &c) const
Definition: Engine.hpp:241
const static result_type _Min
Definition: Engine.hpp:177
void setcounter(const std::pair< ctr_type, result_type > &ce)
Definition: Engine.hpp:274
CBRNG::ukey_type ukey_type
Definition: Engine.hpp:72
Engine(const ukey_type &uk)
Definition: Engine.hpp:217
static R123_CONSTEXPR result_type max R123_NO_MACRO_SUBST()
Definition: Engine.hpp:181
void setkey(const key_type &k)
Definition: Engine.hpp:252
CBRNG::key_type key_type
Definition: Engine.hpp:71
cbrng_type b
Definition: Engine.hpp:76