diff options
author | Julian T <julian@jtle.dk> | 2021-01-17 00:09:15 +0100 |
---|---|---|
committer | Julian T <julian@jtle.dk> | 2021-01-17 00:09:15 +0100 |
commit | 94217187eb2785939458f08d96c7b1b9e55439ab (patch) | |
tree | b10e4ab95f213b13b90ac5e0053ed9e92f973693 /src/core/random.hpp | |
parent | ed14718ff073e285374fad2d3471552b9b497825 (diff) |
Minor changed and draft for random samplingold_rework
Diffstat (limited to 'src/core/random.hpp')
-rw-r--r-- | src/core/random.hpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/core/random.hpp b/src/core/random.hpp new file mode 100644 index 0000000..bc6a173 --- /dev/null +++ b/src/core/random.hpp @@ -0,0 +1,20 @@ +#ifndef RANDOM_H +#define RANDOM_H + +#include <random> + +// TODO think more about +class Random { + public: + Random(int seed = 0) : m_gen(seed), m_dist(0, 1) {} + + inline double getDouble() { + return m_dist(m_gen); + }; + + private: + std::minstd_rand m_gen; + std::uniform_real_distribution<double> m_dist; +}; + +#endif |