Lattice Microbes 2.5
This is for whole cell modeling
Loading...
Searching...
No Matches
lm::rng::RandomGenerator Class Referenceabstract

Base class for random number generators in Lattice Microbes. More...

#include <RandomGenerator.h>

Inheritance diagram for lm::rng::RandomGenerator:
[legend]

Public Types

enum  Distributions {
  NONE = 0x00 , UNIFORM = 0x01 , EXPONENTIAL = 0x02 , NORMAL = 0x04 ,
  ALL = 0xFF
}
 Types of random number generators that are allowed. More...

Public Member Functions

 RandomGenerator (uint32_t seedTop, uint32_t seedBottom, Distributions availableDists=(Distributions)(ALL))
virtual ~RandomGenerator ()
virtual uint64_t getSeed ()
 Get the current seed.
virtual uint32_t getRandom ()=0
 Get a random integer.
virtual double getRandomDouble ()=0
 Get a random double.
virtual double getExpRandomDouble ()=0
 Get a random exponentially distributed double.
virtual double getNormRandomDouble ()=0
 Get a random normally distributed double.
virtual void getRandomDoubles (double *rngs, int numberRNGs)
 Get a number of random doubles.
virtual void getExpRandomDoubles (double *rngs, int numberRNGs)
 Get a number of random exponentially distiributed doubles.
virtual void getNormRandomDoubles (double *rngs, int numberRNGs)
 Get a number of random normally distributed doubles.

Protected Attributes

uint64_t seed
Distributions availableDists

Detailed Description

Base class for random number generators in Lattice Microbes.

Member Enumeration Documentation

◆ Distributions

Types of random number generators that are allowed.

Enumerator
NONE 
UNIFORM 
EXPONENTIAL 
NORMAL 
ALL 

Constructor & Destructor Documentation

◆ RandomGenerator()

lm::rng::RandomGenerator::RandomGenerator ( uint32_t seedTop,
uint32_t seedBottom,
Distributions availableDists = (Distributions)(ALL) )
Here is the caller graph for this function:

◆ ~RandomGenerator()

virtual lm::rng::RandomGenerator::~RandomGenerator ( )
inlinevirtual

Member Function Documentation

◆ getExpRandomDouble()

virtual double lm::rng::RandomGenerator::getExpRandomDouble ( )
pure virtual

Get a random exponentially distributed double.

Returns
random A random double

Implemented in lm::rng::XORShift, and lm::rng::XORWow.

Here is the caller graph for this function:

◆ getExpRandomDoubles()

void lm::rng::RandomGenerator::getExpRandomDoubles ( double * rngs,
int numberRNGs )
virtual

Get a number of random exponentially distiributed doubles.

Parameters
rngsA preallocated array for random numbers
numberRNGsNumber or randoms to put in array

Reimplemented in lm::rng::XORShift, and lm::rng::XORWow.

Here is the call graph for this function:

◆ getNormRandomDouble()

virtual double lm::rng::RandomGenerator::getNormRandomDouble ( )
pure virtual

Get a random normally distributed double.

Returns
random A random double

Implemented in lm::rng::XORShift, and lm::rng::XORWow.

Here is the caller graph for this function:

◆ getNormRandomDoubles()

void lm::rng::RandomGenerator::getNormRandomDoubles ( double * rngs,
int numberRNGs )
virtual

Get a number of random normally distributed doubles.

Parameters
rngsA preallocated array for random numbers
numberRNGsNumber or randoms to put in array

Reimplemented in lm::rng::XORShift, and lm::rng::XORWow.

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

◆ getRandom()

virtual uint32_t lm::rng::RandomGenerator::getRandom ( )
pure virtual

Get a random integer.

Returns
random A random integer

Implemented in lm::rng::XORShift, and lm::rng::XORWow.

◆ getRandomDouble()

virtual double lm::rng::RandomGenerator::getRandomDouble ( )
pure virtual

Get a random double.

Returns
random A random double

Implemented in lm::rng::XORShift, and lm::rng::XORWow.

Here is the caller graph for this function:

◆ getRandomDoubles()

void lm::rng::RandomGenerator::getRandomDoubles ( double * rngs,
int numberRNGs )
virtual

Get a number of random doubles.

Parameters
rngsA preallocated array for random numbers
numberRNGsNumber or randoms to put in array

Reimplemented in lm::rng::XORShift, and lm::rng::XORWow.

Here is the call graph for this function:

◆ getSeed()

virtual uint64_t lm::rng::RandomGenerator::getSeed ( )
inlinevirtual

Get the current seed.

Returns
seed

Member Data Documentation

◆ availableDists

Distributions lm::rng::RandomGenerator::availableDists
protected

◆ seed

uint64_t lm::rng::RandomGenerator::seed
protected

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