CellModules
Rand Namespace Reference

Functions

static std::uniform_real_distribution< double > probaGen (0., 1.)
 @ignore More...
 
static void initRandomSeed (int seed=clock())
 Initializes the random seed. More...
 
static double getProba ()
 Generates a random probability between 0 and 1. More...
 
static double getUniformDouble (double min, double max)
 Generates a random double in a uniform distribution. More...
 
static int getUniformInt (int min, int max)
 Generates a random integer in a uniform distribution. More...
 
static double getNormalDouble (double mean, double var)
 Generates a random double in a normal distribution. More...
 
static double getExponentialDouble (double lambda)
 Generates a random double in an exponential distribution. More...
 
static double getBoundedNormalDouble (double mean, double bound)
 Generates a random double in a bounded normal distribution. More...
 
static double getLinearDouble (std::vector< std::pair< double, double > > values)
 Generates a random double in a piecewise linear distribution. More...
 
static double getLogNormalDouble (double mu, double sigma2)
 Generates a random double in a log-normal distribution. More...
 
static double getLogNormalDoubleMeanStd (double mean, double std)
 Generates a random double in a log-normal distribution using mean and standard deviation. More...
 

Function Documentation

◆ getBoundedNormalDouble()

static double Rand::getBoundedNormalDouble ( double  mean,
double  bound 
)
inlinestatic

Generates a random double in a bounded normal distribution.

Parameters
meanThe mean of the distribution.
boundThe bound of the distribution.
Returns
A random double with the specified mean and bound.

Definition at line 84 of file RandomManager.hpp.

◆ getExponentialDouble()

static double Rand::getExponentialDouble ( double  lambda)
inlinestatic

Generates a random double in an exponential distribution.

Parameters
lambdaThe rate parameter of the distribution.
Returns
A random double with the specified rate parameter.

Definition at line 72 of file RandomManager.hpp.

◆ getLinearDouble()

static double Rand::getLinearDouble ( std::vector< std::pair< double, double > >  values)
inlinestatic

Generates a random double in a piecewise linear distribution.

Parameters
valuesA vector of pairs representing the intervals and weights.
Returns
A random double in the specified piecewise linear distribution.

Definition at line 95 of file RandomManager.hpp.

◆ getLogNormalDouble()

static double Rand::getLogNormalDouble ( double  mu,
double  sigma2 
)
inlinestatic

Generates a random double in a log-normal distribution.

Parameters
muThe mean of the underlying normal distribution.
sigma2The variance of the underlying normal distribution.
Returns
A random double in the specified log-normal distribution.

Definition at line 113 of file RandomManager.hpp.

◆ getLogNormalDoubleMeanStd()

static double Rand::getLogNormalDoubleMeanStd ( double  mean,
double  std 
)
inlinestatic

Generates a random double in a log-normal distribution using mean and standard deviation.

Parameters
meanThe mean of the distribution.
stdThe standard deviation of the distribution.
Returns
A random double in the specified log-normal distribution.

Definition at line 125 of file RandomManager.hpp.

◆ getNormalDouble()

static double Rand::getNormalDouble ( double  mean,
double  var 
)
inlinestatic

Generates a random double in a normal distribution.

Parameters
meanThe mean of the distribution.
varThe variance of the distribution.
Returns
A random double with the specified mean and variance.

Definition at line 61 of file RandomManager.hpp.

◆ getProba()

static double Rand::getProba ( )
inlinestatic

Generates a random probability between 0 and 1.

Returns
A random probability.

Definition at line 28 of file RandomManager.hpp.

◆ getUniformDouble()

static double Rand::getUniformDouble ( double  min,
double  max 
)
inlinestatic

Generates a random double in a uniform distribution.

Parameters
minThe minimum value.
maxThe maximum value.
Returns
A random double between min and max.

Definition at line 37 of file RandomManager.hpp.

◆ getUniformInt()

static int Rand::getUniformInt ( int  min,
int  max 
)
inlinestatic

Generates a random integer in a uniform distribution.

Parameters
minThe minimum value.
maxThe maximum value.
Returns
A random integer between min and max.

Definition at line 49 of file RandomManager.hpp.

◆ initRandomSeed()

static void Rand::initRandomSeed ( int  seed = clock())
inlinestatic

Initializes the random seed.

Parameters
seedThe seed value. Defaults to the current clock value.

Definition at line 21 of file RandomManager.hpp.

◆ probaGen()

static std::uniform_real_distribution< double > Rand::probaGen ( 0.  ,
1.   
)
static

@ignore