19 #include "SquaresKeys.hpp" 53 typedef uint64_t init_type;
54 typedef uint64_t state_type;
55 typedef uint64_t seed_type;
56 typedef uint64_t advance_type;
57 typedef uint32_t result_type;
63 , seed_(seed_type{splitmix<seed_type>(s)}) {}
66 : state_(other.getState())
67 , seed_(other.getSeed()) {}
70 if (
this == &other)
return *
this;
72 state_ = other.getState();
73 seed_ = other.getSeed();
78 inline result_type operator()(
void) {
81 y = x = seed_ * state_;
85 x = (x >> 32) | (x << 32);
88 x = (x >> 32) | (x << 32);
92 return (x * x + y) >> 32;
95 inline void discard(advance_type n) { state_ += n; }
97 inline seed_type getSeed()
const {
return seed_; }
99 inline void setSeed(seed_type seed) { seed_ = seed; }
101 inline state_type getState()
const {
return state_; }
103 inline void setState(state_type state) { state_ = state; }
105 inline static uint64_t generateSeed(
size_t i) {
return keys[i]; }
107 static constexpr result_type min() {
return 0; }
109 static constexpr result_type max() {
110 return std::numeric_limits<result_type>::max();
113 friend inline std::ostream& operator<<(std::ostream& os,
const Squares3_64& be) {
114 return os <<
"state: " << be.getState() <<
" seed: " << be.getSeed();