Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROOT::Math::RandomFunctions< EngineType, ROOT::Math::GSLRandomEngine > Class Template Reference

template<class EngineType>
class ROOT::Math::RandomFunctions< EngineType, ROOT::Math::GSLRandomEngine >

Specialized implementation of the Random functions based on the GSL library.

These will work onlmy with a GSLRandomEngine type

Definition at line 43 of file GSLRandomFunctions.h.

Public Member Functions

 RandomFunctions ()
 
 RandomFunctions (EngineType &rng)
 
double Beta (double a, double b)
 Beta distribution.
 
int Binomial (int ntot, double prob)
 Generate binomial numbers.
 
unsigned int Binomial (unsigned int ntot, double prob)
 Binomial distribution.
 
double BreitWigner (double mean=0., double gamma=1)
 Breit Wigner distribution.
 
double ChiSquare (double nu)
 Chi square distribution.
 
void Circle (double &x, double &y, double r=1)
 generate random numbers in a 2D circle of radious 1
 
EngineTypeEngine ()
 
double Exp (double tau)
 Exponential distribution.
 
double FDist (double nu1, double nu2)
 F distribution.
 
double Gamma (double a, double b)
 Gamma distribution.
 
double Gaus (double mean=0, double sigma=1)
 Gaussian distribution.
 
double GausACR (double mean, double sigma)
 generate random numbers according to the Acceptance-Complement-Ratio method
 
double GausBM (double mean=0, double sigma=1)
 Gaussian distribution (Box-Muller method)
 
double GausR (double mean=0, double sigma=1)
 Gaussian distribution (Ratio Method)
 
void Gaussian2D (double sigmaX, double sigmaY, double rho, double &x, double &y)
 Bivariate Gaussian distribution with correlation.
 
void GaussianND (size_t n, const double *meanVec, const double *covMatrix, double *x, double *lmat=nullptr)
 Multi-variate Gaussian distribution with correlation.
 
double GaussianTail (double a, double sigma=1)
 Gaussian Tail distribution.
 
double GausZig (double mean, double sigma)
 
double Landau (double mean=0, double sigma=1)
 Landau distribution.
 
double Logistic (double a)
 Logistic distribution.
 
double LogNormal (double zeta, double sigma)
 Log Normal distribution.
 
std::vector< unsigned intMultinomial (unsigned int ntot, const std::vector< double > &p)
 Multinomial distribution.
 
std::vector< unsigned intMultiNomial (unsigned int, const std::vector< double > &)
 
unsigned int NegativeBinomial (double n, double prob)
 Negative Binomial distribution First parameter is n, second is probability To be consistent with Random::Binomial.
 
double operator() ()
 non-virtual method
 
double Pareto (double a, double b)
 Pareto distribution.
 
unsigned int Poisson (double mu)
 Poisson distribution.
 
double PoissonD (double mean)
 
void Rannor (double &a, double &b)
 Generate numbers distributed following a gaussian with mean=0 and sigma=1.
 
double Rayleigh (double sigma)
 Rayleigh distribution.
 
void Sphere (double &x, double &y, double &z, double r=1)
 generate random numbers in a 3D sphere of radious 1
 
double tDist (double nu)
 t student distribution
 
double Uniform (double a)
 generate random numbers following a Uniform distribution in the [0,a] interval
 
double Uniform (double a, double b)
 generate random numbers following a Uniform distribution in the [a,b] interval
 

Protected Member Functions

double Rndm_impl ()
 Internal implementation to return random number Since this one is not a virtual function is faster than Rndm.
 
EngineTypeRng ()
 

Private Attributes

EngineTypefEngine
 ! random number generator engine
 
RandomFunctionsImpl< DefaultEngineTypefImpl
 ! instance of the class implementing the functions
 

#include <Math/GSLRandomFunctions.h>

Inheritance diagram for ROOT::Math::RandomFunctions< EngineType, ROOT::Math::GSLRandomEngine >:
[legend]

Constructor & Destructor Documentation

◆ RandomFunctions() [1/2]

Definition at line 50 of file GSLRandomFunctions.h.

◆ RandomFunctions() [2/2]

Definition at line 52 of file GSLRandomFunctions.h.

Member Function Documentation

◆ Beta()

Beta distribution.

Definition at line 141 of file GSLRandomFunctions.h.

◆ Binomial() [1/2]

int ROOT::Math::RandomFunctions< EngineType , DefaultEngineType >::Binomial ( int ntot,
double prob )
inlineinherited

Generate binomial numbers.

Definition at line 160 of file RandomFunctions.h.

◆ Binomial() [2/2]

template<class EngineType >
unsigned int ROOT::Math::RandomFunctions< EngineType, ROOT::Math::GSLRandomEngine >::Binomial ( unsigned int ntot,
double prob )
inline

Binomial distribution.

Definition at line 222 of file GSLRandomFunctions.h.

◆ BreitWigner()

template<class EngineType >
double ROOT::Math::RandomFunctions< EngineType, ROOT::Math::GSLRandomEngine >::BreitWigner ( double mean = 0.,
double gamma = 1 )
inline

Breit Wigner distribution.

Definition at line 120 of file GSLRandomFunctions.h.

◆ ChiSquare()

Chi square distribution.

Definition at line 155 of file GSLRandomFunctions.h.

◆ Circle()

template<class EngineType >
void ROOT::Math::RandomFunctions< EngineType, ROOT::Math::GSLRandomEngine >::Circle ( double & x,
double & y,
double r = 1 )
inline

generate random numbers in a 2D circle of radious 1

Definition at line 196 of file GSLRandomFunctions.h.

◆ Engine()

◆ Exp()

Exponential distribution.

Definition at line 114 of file GSLRandomFunctions.h.

◆ FDist()

F distribution.

Definition at line 162 of file GSLRandomFunctions.h.

◆ Gamma()

Gamma distribution.

Definition at line 134 of file GSLRandomFunctions.h.

◆ Gaus()

Gaussian distribution.

Default method (use Ziggurat)

Definition at line 68 of file GSLRandomFunctions.h.

◆ GausACR()

double ROOT::Math::RandomFunctions< EngineType , DefaultEngineType >::GausACR ( double mean,
double sigma )
inlineinherited

generate random numbers according to the Acceptance-Complement-Ratio method

Definition at line 188 of file RandomFunctions.h.

◆ GausBM()

Gaussian distribution (Box-Muller method)

Definition at line 75 of file GSLRandomFunctions.h.

◆ GausR()

Gaussian distribution (Ratio Method)

Definition at line 82 of file GSLRandomFunctions.h.

◆ Gaussian2D()

template<class EngineType >
void ROOT::Math::RandomFunctions< EngineType, ROOT::Math::GSLRandomEngine >::Gaussian2D ( double sigmaX,
double sigmaY,
double rho,
double & x,
double & y )
inline

Bivariate Gaussian distribution with correlation.

Definition at line 96 of file GSLRandomFunctions.h.

◆ GaussianND()

template<class EngineType >
void ROOT::Math::RandomFunctions< EngineType, ROOT::Math::GSLRandomEngine >::GaussianND ( size_t n,
const double * meanVec,
const double * covMatrix,
double * x,
double * lmat = nullptr )
inline

Multi-variate Gaussian distribution with correlation.

The covMatrix is a pointer to the covcariance matrix (NxN) Lmat is a pointer to store the factorized Cholesky decomposition C = LL^T of the covariance matrix If the generator is to be called again with the same covariance one can provide a null CovMAtrix and only lmat

Definition at line 107 of file GSLRandomFunctions.h.

◆ GaussianTail()

Gaussian Tail distribution.

Definition at line 89 of file GSLRandomFunctions.h.

◆ GausZig()

Definition at line 57 of file GSLRandomFunctions.h.

◆ Landau()

Landau distribution.

Definition at line 127 of file GSLRandomFunctions.h.

◆ Logistic()

Logistic distribution.

Definition at line 182 of file GSLRandomFunctions.h.

◆ LogNormal()

Log Normal distribution.

Definition at line 148 of file GSLRandomFunctions.h.

◆ Multinomial()

template<class EngineType >
std::vector< unsigned int > ROOT::Math::RandomFunctions< EngineType, ROOT::Math::GSLRandomEngine >::Multinomial ( unsigned int ntot,
const std::vector< double > & p )
inline

Multinomial distribution.

Definition at line 238 of file GSLRandomFunctions.h.

◆ MultiNomial()

std::vector< unsigned int > ROOT::Math::RandomFunctions< EngineType , DefaultEngineType >::MultiNomial ( unsigned int ,
const std::vector< double > &  )
inlineinherited

Definition at line 289 of file RandomFunctions.h.

◆ NegativeBinomial()

template<class EngineType >
unsigned int ROOT::Math::RandomFunctions< EngineType, ROOT::Math::GSLRandomEngine >::NegativeBinomial ( double n,
double prob )
inline

Negative Binomial distribution First parameter is n, second is probability To be consistent with Random::Binomial.

Definition at line 231 of file GSLRandomFunctions.h.

◆ operator()()

non-virtual method

Definition at line 156 of file RandomFunctions.h.

◆ Pareto()

Pareto distribution.

Definition at line 189 of file GSLRandomFunctions.h.

◆ Poisson()

Poisson distribution.

Definition at line 215 of file GSLRandomFunctions.h.

◆ PoissonD()

double ROOT::Math::RandomFunctions< EngineType , DefaultEngineType >::PoissonD ( double mean)
inlineinherited

Definition at line 202 of file RandomFunctions.h.

◆ Rannor()

void ROOT::Math::RandomFunctions< EngineType , DefaultEngineType >::Rannor ( double & a,
double & b )
inlineinherited

Generate numbers distributed following a gaussian with mean=0 and sigma=1.

Using the Box-Muller method

Definition at line 206 of file RandomFunctions.h.

◆ Rayleigh()

Rayleigh distribution.

Definition at line 175 of file GSLRandomFunctions.h.

◆ Rndm_impl()

double ROOT::Math::RandomFunctions< EngineType , DefaultEngineType >::Rndm_impl ( )
inlineprotectedinherited

Internal implementation to return random number Since this one is not a virtual function is faster than Rndm.

Definition at line 301 of file RandomFunctions.h.

◆ Rng()

EngineType & ROOT::Math::RandomFunctions< EngineType , DefaultEngineType >::Rng ( )
inlineprotectedinherited

Definition at line 297 of file RandomFunctions.h.

◆ Sphere()

template<class EngineType >
void ROOT::Math::RandomFunctions< EngineType, ROOT::Math::GSLRandomEngine >::Sphere ( double & x,
double & y,
double & z,
double r = 1 )
inline

generate random numbers in a 3D sphere of radious 1

Definition at line 205 of file GSLRandomFunctions.h.

◆ tDist()

t student distribution

Definition at line 169 of file GSLRandomFunctions.h.

◆ Uniform() [1/2]

generate random numbers following a Uniform distribution in the [0,a] interval

Definition at line 222 of file RandomFunctions.h.

◆ Uniform() [2/2]

generate random numbers following a Uniform distribution in the [a,b] interval

Definition at line 217 of file RandomFunctions.h.

Member Data Documentation

◆ fEngine

! random number generator engine

Definition at line 306 of file RandomFunctions.h.

◆ fImpl

! instance of the class implementing the functions

Definition at line 307 of file RandomFunctions.h.

  • math/mathmore/inc/Math/GSLRandomFunctions.h