CPP Linear Algebra ToolBox  0.1.0
utils.cpp File Reference
Include dependency graph for utils.cpp:

Functions

std::mt19937 gen (rd())
 
double uniform_distribution (double a=0., double b=1.)
 Generate a random number using the uniform distribution. More...
 
double normal_distribution (double m=0., double s=1.)
 Generate a random umber using the Gaussian distribution. More...
 

Variables

std::random_device rd
 

Function Documentation

◆ gen()

std::mt19937 gen ( rd()  )

◆ normal_distribution()

double normal_distribution ( double  m = 0.,
double  s = 1. 
)

Generate a random umber using the Gaussian distribution.

Parameters
mMean value of the distribution, default \(m=0\).
sStandart deviation of the distribution, default \(s=1\).
Returns
double A random number picked following the Gaussian distribution \(\mathcal{N}(m,s)\).

◆ uniform_distribution()

double uniform_distribution ( double  a = 0.,
double  b = 1. 
)

Generate a random number using the uniform distribution.

Parameters
aLower bound of the interval, default \(a=0\)
bUpper bound of the interval ( \(b > a\)), default \(b=1\).
Returns
double A random number picked uniformaly between \([a,b)\),

Variable Documentation

◆ rd

std::random_device rd