Wildmeshing Toolkit
random_seed.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <random>
4 
5 namespace wmtk::utils {
6 
8 {
9 public:
11  {
12  static RandomSeedSingleton _instance;
13  return _instance;
14  }
15 
16  inline void set_seed(uint64_t val) { m_gen.seed(val); std::srand(val); }
17  inline unsigned int get_seed() { return m_gen(); }
18 
19 private:
21  {
22  std::random_device rd;
23  set_seed(rd());
24  }
25 
26  std::mt19937 m_gen;
27 };
28 
29 
30 inline unsigned int get_random_seed()
31 {
33 }
34 
35 inline void set_random_seed(uint64_t val)
36 {
38 }
39 
40 } // namespace wmtk::utils
static RandomSeedSingleton & instance()
Definition: random_seed.hpp:10
unsigned int get_random_seed()
Definition: random_seed.hpp:30
void set_random_seed(uint64_t val)
Definition: random_seed.hpp:35