17 #ifndef ROOT_Math_GSLRandomFunctions 18 #define ROOT_Math_GSLRandomFunctions 40 template <
class EngineType >
55 double GausZig(
double mean,
double sigma) {
56 return Engine().GaussianZig(sigma) + mean;
66 double Gaus(
double mean = 0,
double sigma = 1) {
67 return mean + Engine().GaussianZig(sigma);
73 double GausBM(
double mean = 0,
double sigma = 1) {
74 return mean + Engine().Gaussian(sigma);
80 double GausR(
double mean = 0,
double sigma = 1) {
81 return mean + Engine().GaussianRatio(sigma);
88 return Engine().GaussianTail(a,sigma);
94 void Gaussian2D(
double sigmaX,
double sigmaY,
double rho,
double &
x,
double &
y) {
95 Engine().Gaussian2D(sigmaX, sigmaY, rho, x, y);
102 return Engine().Exponential(tau);
108 return mean + Engine().Cauchy(
gamma/2.0 );
114 double Landau(
double mean = 0,
double sigma = 1) {
115 return mean + sigma*Engine().Landau();
122 return Engine().Gamma(a,b);
129 return Engine().Beta(a,b);
136 return Engine().LogNormal(zeta,sigma);
143 return Engine().ChiSquare(nu);
149 double FDist(
double nu1,
double nu2) {
150 return Engine().FDist(nu1,nu2);
157 return Engine().tDist(nu);
163 return Engine().Rayleigh(sigma);
170 return Engine().Logistic(a);
177 return Engine().Pareto(a,b);
192 void Sphere(
double &
x,
double &
y,
double &
z,
double r = 1) {
193 Engine().Dir3D(x,y,z);
203 return Engine().Poisson(mu);
209 unsigned int Binomial(
unsigned int ntot,
double prob) {
210 return Engine().Binomial(prob,ntot);
219 return Engine().NegativeBinomial(prob,n);
225 std::vector<unsigned int>
Multinomial(
unsigned int ntot,
const std::vector<double> & p ) {
226 return Engine().Multinomial(ntot,p);
unsigned int NegativeBinomial(double n, double prob)
Negative Binomial distribution First parameter is n, second is probability To be consistent with Rand...
double LogNormal(double zeta, double sigma)
Log Normal distribution.
double BreitWigner(double mean=0., double gamma=1)
Breit Wigner distribution.
double Exp(double tau)
Exponential distribution.
double Pareto(double a, double b)
Pareto distribution.
double Logistic(double a)
Logistic distribution.
Namespace for new ROOT classes and functions.
double Beta(double a, double b)
Beta distribution.
double GausZig(double mean, double sigma)
double Gaus(double mean=0, double sigma=1)
Gaussian distribution.
you should not use this method at all Int_t y
void Gaussian2D(double sigmaX, double sigmaY, double rho, double &x, double &y)
Bivariate Gaussian distribution with correlation.
double ChiSquare(double nu)
Chi square distribution.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t tau
GSLRandomEngine Base class for all GSL random engines, normally user instantiate the derived classes ...
double GausBM(double mean=0, double sigma=1)
Gaussian distribution (Box-Muller method)
double Gamma(double a, double b)
Gamma distribution.
double Landau(double mean=0, double sigma=1)
Landau distribution.
double tDist(double nu)
t student distribution
void Sphere(double &x, double &y, double &z, double r=1)
generate random numbers in a 3D sphere of radious 1
void Circle(double &x, double &y, double r=1)
generate random numbers in a 2D circle of radious 1
double FDist(double nu1, double nu2)
F distrbution.
double GausR(double mean=0, double sigma=1)
Gaussian distribution (Ratio Method)
unsigned int Binomial(unsigned int ntot, double prob)
Binomial distribution.
* x
Deprecated and error prone model selection interface.
double Rayleigh(double sigma)
Rayleigh distribution.
std::vector< unsigned int > Multinomial(unsigned int ntot, const std::vector< double > &p)
Multinomial distribution.
unsigned int Poisson(double mu)
Poisson distribution.
Namespace for new Math classes and functions.
you should not use this method at all Int_t Int_t z
double GaussianTail(double a, double sigma=1)
Gaussian Tail distribution.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
RandomFunctions(EngineType &rng)