PARTONS/NumA++  
Numerical Analysis C++ routines
Public Member Functions | Static Public Attributes | Private Attributes | List of all members
NumA::RandomGenerator Class Reference

Public Member Functions

 RandomGenerator ()
 Default constructor. More...
 
virtual ~RandomGenerator ()
 Destructor. More...
 
void configure (const ElemUtils::Parameters &parameters)
 Provides a generic method to configure all types of integrations by passing a Parameters object. More...
 
size_t setSeed (size_t seed)
 Set new seed. More...
 
size_t getSeed () const
 Get seed. More...
 
double diceFlat () const
 Dice double precision number from flat distribution in range [0, 1). More...
 
double diceFlat (double min, double max) const
 Dice double precision number from flat distribution in given range. More...
 
double diceNormal () const
 Dice double precision number from normal distribution with mean = 0 and sigma = 1. More...
 
double diceNormal (double mean, double sigma) const
 Dice double precision number from normal distribution with given mean and sigma. More...
 
double diceExp () const
 Dice double precision number from exponential distribution with lambda (negative slope) = 1. More...
 
double diceExp (double lambda) const
 Dice double precision number from exponential distribution with given lambda (negative slope). More...
 
double diceExp (double min, double max, double lambda) const
 Dice double precision number from exponential distribution with given lambda (negative slope) in given range. More...
 

Static Public Attributes

static const std::string PARAM_NAME_SEED = "seed"
 Seed. More...
 

Private Attributes

size_t m_seed
 Seed. More...
 

Constructor & Destructor Documentation

◆ RandomGenerator()

NumA::RandomGenerator::RandomGenerator ( )

Default constructor.

◆ ~RandomGenerator()

NumA::RandomGenerator::~RandomGenerator ( )
virtual

Destructor.

Member Function Documentation

◆ configure()

void NumA::RandomGenerator::configure ( const ElemUtils::Parameters &  parameters)

Provides a generic method to configure all types of integrations by passing a Parameters object.

Parameters class represents a list of couples key/value (see Parameters class documentation for more info).

Parameters
parametersElemUtils::Parameters object.

◆ diceExp() [1/3]

double NumA::RandomGenerator::diceExp ( ) const

Dice double precision number from exponential distribution with lambda (negative slope) = 1.

◆ diceExp() [2/3]

double NumA::RandomGenerator::diceExp ( double  lambda) const

Dice double precision number from exponential distribution with given lambda (negative slope).

◆ diceExp() [3/3]

double NumA::RandomGenerator::diceExp ( double  min,
double  max,
double  lambda 
) const

Dice double precision number from exponential distribution with given lambda (negative slope) in given range.

◆ diceFlat() [1/2]

double NumA::RandomGenerator::diceFlat ( ) const

Dice double precision number from flat distribution in range [0, 1).

◆ diceFlat() [2/2]

double NumA::RandomGenerator::diceFlat ( double  min,
double  max 
) const

Dice double precision number from flat distribution in given range.

Parameters
minMin.
maxMax..

◆ diceNormal() [1/2]

double NumA::RandomGenerator::diceNormal ( ) const

Dice double precision number from normal distribution with mean = 0 and sigma = 1.

◆ diceNormal() [2/2]

double NumA::RandomGenerator::diceNormal ( double  mean,
double  sigma 
) const

Dice double precision number from normal distribution with given mean and sigma.

Parameters
meanMean.
sigmaSigma.

◆ getSeed()

size_t NumA::RandomGenerator::getSeed ( ) const

Get seed.

◆ setSeed()

size_t NumA::RandomGenerator::setSeed ( size_t  seed)

Set new seed.

Parameters
seed'0' for time-based seed or fixed seed.
Returns
Value of new seed.

Member Data Documentation

◆ m_seed

size_t NumA::RandomGenerator::m_seed
private

Seed.

◆ PARAM_NAME_SEED

const std::string NumA::RandomGenerator::PARAM_NAME_SEED = "seed"
static

Seed.


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