Health-GPS 3.0.0.0
Global Health Policy Simulation model (Health-GPS)
Loading...
Searching...
No Matches
randombit_generator.h
Go to the documentation of this file.
1#pragma once
2
3#include <limits>
4#include <vector>
5
6namespace hgps {
7
10 public:
11 using result_type = unsigned int;
12
14 virtual ~RandomBitGenerator() = default;
15
18 virtual void seed(const unsigned int seed) = 0;
19
22 virtual void discard(const unsigned long long skip) = 0;
23
26 virtual unsigned int next() = 0;
27
30 virtual double next_double() noexcept = 0;
31
34 static constexpr result_type min() { return std::numeric_limits<result_type>::min(); }
35
38 static constexpr result_type max() { return std::numeric_limits<result_type>::max(); }
39};
40} // namespace hgps
Pseudo-random number generator algorithm interface.
Definition randombit_generator.h:9
static constexpr result_type min()
Gets the smallest possible value in the output range.
Definition randombit_generator.h:34
virtual unsigned int next()=0
Generates the next random number.
static constexpr result_type max()
Gets the largest possible value in the output range.
Definition randombit_generator.h:38
virtual void discard(const unsigned long long skip)=0
Advances the engine's state by a specified amount.
unsigned int result_type
Definition randombit_generator.h:11
virtual ~RandomBitGenerator()=default
Destroys a RandomBitGenerator instance.
virtual void seed(const unsigned int seed)=0
Sets the current state of the generator engine.
virtual double next_double() noexcept=0
Generates a random floating point number in range [0,1)
Top-level namespace for Health-GPS Console host application.
Definition command_options.cpp:8