19 #include "SquaresKeys.hpp" 20 #include "uint128.hpp" 57 typedef uint64_t advance_type;
58 typedef uint64_t result_type;
63 : state_(uint64_t(stream) << 32, 0)
64 , seed_(seed_type{splitmix<size_t>(s)}) {}
67 : state_(other.getState())
68 , seed_(other.getSeed()) {}
71 if (
this == &other)
return *
this;
73 state_ = other.getState();
74 seed_ = other.getSeed();
79 inline result_type operator()(
void) {
82 y = x = seed_ * state_;
93 return (x * x + y).upper();
96 inline void discard(advance_type n) { state_ += n; }
98 inline seed_type getSeed()
const {
return seed_; }
100 inline void setSeed(seed_type seed) { seed_ = seed; }
102 inline state_type getState()
const {
return state_; }
104 inline void setState(state_type state) { state_ = state; }
106 inline static uint64_t generateSeed(
size_t i) {
return keys[i]; }
108 friend inline std::ostream& operator<<(std::ostream& os,
const Squares3_128& be) {
109 return os <<
"state: " << be.getState() <<
" seed: " << be.getSeed();
112 static constexpr result_type min() {
return 0; }
114 static constexpr result_type max() {
115 return std::numeric_limits<result_type>::max();