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();
120 template <
typename SeedSeq>
122 #
if R123_USE_CXX11_TYPE_TRAITS
123 ,
typename std::enable_if<!std::is_convertible<SeedSeq, result_type>::value>::type* =0
134 template <
typename SeedSeq>
136 #
if R123_USE_CXX11_TYPE_TRAITS
137 ,
typename std::enable_if<!std::is_convertible<SeedSeq, result_type>::value>::type* =0
146 return lhs.
c==rhs.
c && lhs.
v.back() == rhs.
v.back() && lhs.
key == rhs.
key;
149 return lhs.
c!=rhs.
c || lhs.
v.back()!=rhs.
v.back() || lhs.
key!=rhs.
key;
153 return os << be.
c <<
" " << be.
key <<
" " << be.
v.back();
157 is >> be.
c >> be.
key >> be.
v.back();
181 return b(
c.incr(),
key)[0];
194 size_t nelem =
c.size();
195 size_t sub = skip % nelem;
222 #if R123_USE_CXX11_TYPE_TRAITS
223 template <
typename DUMMY=
void>
225 typename std::enable_if<!std::is_same<ukey_type, key_type>::value, DUMMY>::type* = 0)
226 :
key(k),
c(){
v.back() = 0; }
228 template <
typename DUMMY=
void>
230 typename std::enable_if<!std::is_same<ukey_type, key_type>::value, DUMMY>::type* = 0){
257 return std::make_pair(
c,
v.back());
262 static const size_t nelem =
c.size();
264 throw std::range_error(
"Engine::setcounter called with elem out of range");
static R123_CONSTEXPR result_type min R123_NO_MACRO_SUBST()
Definition: Engine.hpp:176
CBRNG cbrng_type
Definition: Engine.hpp:69
Engine(result_type r)
Definition: Engine.hpp:94
ctr_type c
Definition: Engine.hpp:78
friend bool operator!=(const Engine &lhs, const Engine &rhs)
Definition: Engine.hpp:148
void setkey(const key_type &k)
Definition: Engine.hpp:248
Engine(SeedSeq &s)
Definition: Engine.hpp:121
Engine(ukey_type &uk)
Definition: Engine.hpp:214
key_type key
Definition: Engine.hpp:77
std::pair< ctr_type, result_type > getcounter() const
Definition: Engine.hpp:256
Engine(Engine &e)
Definition: Engine.hpp:111
Definition: Engine.hpp:68
CBRNG::ctr_type ctr_type
Definition: Engine.hpp:70
result_type operator()()
Definition: Engine.hpp:179
cbrng_type b
Definition: Engine.hpp:76
static const result_type _Min
Definition: Engine.hpp:173
ctr_type::value_type result_type
Definition: Engine.hpp:73
void setcounter(const std::pair< ctr_type, result_type > &ce)
Definition: Engine.hpp:270
Engine(const ukey_type &uk)
Definition: Engine.hpp:213
ctr_type operator()(const ctr_type &c) const
Definition: Engine.hpp:237
friend std::istream & operator>>(std::istream &is, Engine &be)
Definition: Engine.hpp:156
void setcounter(const ctr_type &_c, result_type _elem)
Definition: Engine.hpp:261
CBRNG::key_type key_type
Definition: Engine.hpp:71
void fix_invariant()
Definition: Engine.hpp:81
void seed(result_type r)
Definition: Engine.hpp:131
void seed(SeedSeq &s)
Definition: Engine.hpp:135
Engine()
Definition: Engine.hpp:89
void discard(R123_ULONG_LONG skip)
Definition: Engine.hpp:192
void seed(ukey_type &uk)
Definition: Engine.hpp:218
void seed()
Definition: Engine.hpp:142
void seed(const ukey_type &uk)
Definition: Engine.hpp:215
key_type getkey() const
Definition: Engine.hpp:241
friend std::ostream & operator<<(std::ostream &os, const Engine &be)
Definition: Engine.hpp:152
Engine(const Engine &e)
Definition: Engine.hpp:115
ctr_type v
Definition: Engine.hpp:79
friend bool operator==(const Engine &lhs, const Engine &rhs)
Definition: Engine.hpp:145
static R123_CONSTEXPR result_type max R123_NO_MACRO_SUBST()
Definition: Engine.hpp:177
CBRNG::ukey_type ukey_type
Definition: Engine.hpp:72
static const result_type _Max
Definition: Engine.hpp:174