17#ifndef ROOT_Math_GSLRandomFunctions
18#define ROOT_Math_GSLRandomFunctions
42 template <
class EngineType >
58 return Engine().GaussianZig(
sigma) + mean;
69 return mean + Engine().GaussianZig(
sigma);
76 return mean + Engine().Gaussian(
sigma);
83 return mean + Engine().GaussianRatio(
sigma);
90 return Engine().GaussianTail(
a,
sigma);
96 void Gaussian2D(
double sigmaX,
double sigmaY,
double rho,
double &
x,
double &
y) {
97 Engine().Gaussian2D(sigmaX, sigmaY, rho,
x,
y);
107 void GaussianND(
size_t n,
const double * meanVec,
const double * covMatrix,
double *
x,
double * lmat =
nullptr) {
108 Engine().GaussianND(
n, meanVec,covMatrix,
x,lmat);
115 return Engine().Exponential(tau);
121 return mean + Engine().Cauchy( gamma/2.0 );
128 return mean +
sigma*Engine().Landau();
135 return Engine().Gamma(
a,
b);
142 return Engine().Beta(
a,
b);
149 return Engine().LogNormal(zeta,
sigma);
156 return Engine().ChiSquare(nu);
162 double FDist(
double nu1,
double nu2) {
163 return Engine().FDist(nu1,nu2);
170 return Engine().tDist(nu);
176 return Engine().Rayleigh(
sigma);
183 return Engine().Logistic(
a);
190 return Engine().Pareto(
a,
b);
205 void Sphere(
double &
x,
double &
y,
double &z,
double r = 1) {
206 Engine().Dir3D(
x,
y,z);
216 return Engine().Poisson(mu);
222 unsigned int Binomial(
unsigned int ntot,
double prob) {
223 return Engine().Binomial(prob,ntot);
232 return Engine().NegativeBinomial(prob,
n);
238 std::vector<unsigned int>
Multinomial(
unsigned int ntot,
const std::vector<double> &
p ) {
239 return Engine().Multinomial(ntot,
p);
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
GSLRandomEngine Base class for all GSL random engines, normally user instantiate the derived classes ...
double Landau(double mean=0, double sigma=1)
Landau distribution.
double Gamma(double a, double b)
Gamma distribution.
void GaussianND(size_t n, const double *meanVec, const double *covMatrix, double *x, double *lmat=nullptr)
Multi-variate Gaussian distribution with correlation.
RandomFunctions(EngineType &rng)
double Exp(double tau)
Exponential distribution.
void Sphere(double &x, double &y, double &z, double r=1)
generate random numbers in a 3D sphere of radious 1
double Pareto(double a, double b)
Pareto distribution.
double Logistic(double a)
Logistic distribution.
void Gaussian2D(double sigmaX, double sigmaY, double rho, double &x, double &y)
Bivariate Gaussian distribution with correlation.
unsigned int NegativeBinomial(double n, double prob)
Negative Binomial distribution First parameter is n, second is probability To be consistent with Rand...
double BreitWigner(double mean=0., double gamma=1)
Breit Wigner distribution.
double GausZig(double mean, double sigma)
unsigned int Binomial(unsigned int ntot, double prob)
Binomial distribution.
double LogNormal(double zeta, double sigma)
Log Normal distribution.
double tDist(double nu)
t student distribution
double GaussianTail(double a, double sigma=1)
Gaussian Tail distribution.
double Beta(double a, double b)
Beta distribution.
void Circle(double &x, double &y, double r=1)
generate random numbers in a 2D circle of radious 1
double GausBM(double mean=0, double sigma=1)
Gaussian distribution (Box-Muller method)
double Gaus(double mean=0, double sigma=1)
Gaussian distribution.
double Rayleigh(double sigma)
Rayleigh distribution.
double FDist(double nu1, double nu2)
F distribution.
double GausR(double mean=0, double sigma=1)
Gaussian distribution (Ratio Method)
std::vector< unsigned int > Multinomial(unsigned int ntot, const std::vector< double > &p)
Multinomial distribution.
unsigned int Poisson(double mu)
Poisson distribution.
double ChiSquare(double nu)
Chi square distribution.
Namespace for new Math classes and functions.
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...