Commit ee5e5b87 authored by Lukas Weber's avatar Lukas Weber

save seeds properly

up to now seeds were not saved to the dump file. Since the state of the
RNG was saved properly and the seed is only used in the initialization,
this likely did not affect the results.
parent 310ae8d5
...@@ -28,7 +28,12 @@ private: ...@@ -28,7 +28,12 @@ private:
return 0; return 0;
} }
uint64_t seed_; void set_seed(uint64_t seed) {
seed_ = seed;
static_cast<base *>(this)->set_seed(seed);
}
uint64_t seed_{};
public: public:
rng_base() { rng_base() {
...@@ -36,11 +41,11 @@ public: ...@@ -36,11 +41,11 @@ public:
static_cast<uint64_t>(get_rank())}; static_cast<uint64_t>(get_rank())};
std::vector<uint64_t> seed(1); std::vector<uint64_t> seed(1);
seq.generate(seed.begin(), seed.end()); seq.generate(seed.begin(), seed.end());
static_cast<base *>(this)->set_seed(seed[0]); set_seed(seed[0]);
}; };
rng_base(uint64_t seed) { rng_base(uint64_t seed) {
static_cast<base *>(this)->set_seed(seed); set_seed(seed);
} }
std::string type() const { std::string type() const {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment