Health-GPS 3.0.0.0
Global Health Policy Simulation model (Health-GPS)
Loading...
Searching...
No Matches
hgps::RandomBitGenerator Class Referenceabstract

Pseudo-random number generator algorithm interface. More...

#include <randombit_generator.h>

Inheritance diagram for hgps::RandomBitGenerator:
[legend]

Public Types

using result_type = unsigned int

Public Member Functions

virtual ~RandomBitGenerator ()=default
 Destroys a RandomBitGenerator instance.
virtual void seed (const unsigned int seed)=0
 Sets the current state of the generator engine.
virtual void discard (const unsigned long long skip)=0
 Advances the engine's state by a specified amount.
virtual unsigned int next ()=0
 Generates the next random number.
virtual double next_double () noexcept=0
 Generates a random floating point number in range [0,1).

Static Public Member Functions

static constexpr result_type min ()
 Gets the smallest possible value in the output range.
static constexpr result_type max ()
 Gets the largest possible value in the output range.

Detailed Description

Pseudo-random number generator algorithm interface.

Member Typedef Documentation

◆ result_type

Constructor & Destructor Documentation

◆ ~RandomBitGenerator()

virtual hgps::RandomBitGenerator::~RandomBitGenerator ( )
virtualdefault

Destroys a RandomBitGenerator instance.

Member Function Documentation

◆ discard()

virtual void hgps::RandomBitGenerator::discard ( const unsigned long long skip)
pure virtual

Advances the engine's state by a specified amount.

Parameters
skipThe number of times to advance the state

Implemented in hgps::MTRandom32.

◆ max()

constexpr result_type hgps::RandomBitGenerator::max ( )
inlinestaticconstexpr

Gets the largest possible value in the output range.

Returns
The maximum potentially generated value.

◆ min()

constexpr result_type hgps::RandomBitGenerator::min ( )
inlinestaticconstexpr

Gets the smallest possible value in the output range.

Returns
The minimum potentially generated value.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ next()

virtual unsigned int hgps::RandomBitGenerator::next ( )
pure virtual

Generates the next random number.

Returns
A pseudo-random number value in [min(), max()]

Implemented in hgps::MTRandom32.

◆ next_double()

virtual double hgps::RandomBitGenerator::next_double ( )
pure virtualnoexcept

Generates a random floating point number in range [0,1).

Returns
A floating point value in range [0,1).

Implemented in hgps::MTRandom32.

◆ seed()

virtual void hgps::RandomBitGenerator::seed ( const unsigned int seed)
pure virtual

Sets the current state of the generator engine.

Parameters
seedThe value to initialise the internal state

Implemented in hgps::MTRandom32.

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file: