Health-GPS  1.2.2.0
Global Health Policy Simulation model (Health-GPS)
randombit_generator.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <limits>
4 #include <vector>
5 
6 namespace hgps {
7 
10  public:
11  using result_type = unsigned int;
12 
14  virtual ~RandomBitGenerator() = default;
15 
18  virtual unsigned int operator()() = 0;
19 
22  virtual void seed(const unsigned int seed) = 0;
23 
26  virtual void discard(const unsigned long long skip) = 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
static constexpr result_type max()
Gets the largest possible value in the output range.
Definition: randombit_generator.h:38
virtual unsigned int operator()()=0
Generates the next random number.
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 C++ API.
Definition: analysis_definition.h:8