Health-GPS 3.0.0.0
Global Health Policy Simulation model (Health-GPS)
Loading...
Searching...
No Matches
mtrandom.h
Go to the documentation of this file.
1#pragma once
2
4#include <random>
5
6namespace hgps {
7
9class MTRandom32 final : public RandomBitGenerator {
10 public:
12 MTRandom32();
13
16 explicit MTRandom32(const unsigned int seed);
17
18 void seed(const unsigned int) override;
19
20 void discard(const unsigned long long skip) override;
21
22 unsigned int next() override;
23
24 double next_double() noexcept override;
25
27 static constexpr unsigned int min() { return std::mt19937::min(); }
28
30 static constexpr unsigned int max() { return std::mt19937::max(); }
31
32 private:
33 std::mt19937 engine_;
34};
35} // namespace hgps
Mersenne Twister random number generator algorithm.
Definition mtrandom.h:9
void seed(const unsigned int) override
Sets the current state of the generator engine.
Definition mtrandom.cpp:15
static constexpr unsigned int min()
Gets the smallest possible value in the output range.
Definition mtrandom.h:27
MTRandom32()
Initialise a new instance of the MTRandom32 class.
Definition mtrandom.cpp:8
unsigned int next() override
Generates the next random number.
Definition mtrandom.cpp:19
void discard(const unsigned long long skip) override
Advances the engine's state by a specified amount.
Definition mtrandom.cpp:17
double next_double() noexcept override
Generates a random floating point number in range [0,1)
Definition mtrandom.cpp:21
static constexpr unsigned int max()
Gets the largest possible value in the output range.
Definition mtrandom.h:30
Pseudo-random number generator algorithm interface.
Definition randombit_generator.h:9
Top-level namespace for Health-GPS Console host application.
Definition command_options.cpp:8