Health-GPS  1.2.2.0
Global Health Policy Simulation model (Health-GPS)
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. More...
 
virtual unsigned int operator() ()=0
 Generates the next random number. More...
 
virtual void seed (const unsigned int seed)=0
 Sets the current state of the generator engine. More...
 
virtual void discard (const unsigned long long skip)=0
 Advances the engine's state by a specified amount. More...
 
virtual double next_double () noexcept=0
 Generates a random floating point number in range [0,1) More...
 

Static Public Member Functions

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

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()

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

Gets the largest possible value in the output range.

Returns
The maximum potentially generated value.

◆ min()

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

Gets the smallest possible value in the output range.

Returns
The minimum potentially generated value.

◆ 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.

◆ operator()()

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

Generates the next random number.

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

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 caller graph for this function:

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