BornAgain
1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
|
Implementation class for the RandomFunction for all the engined that derives from TRandomEngine class, which defines an interface which has TRandomEngine::Rndm() In this way we can have a common implementation for the RandomFunctions
Definition at line 69 of file RandomFunctions.h.
Public Member Functions | |
RandomFunctionsImpl () | |
class constructor More... | |
int | Binomial (int ntot, double prob) |
Generate binomial numbers. More... | |
double | BreitWigner (double mean, double gamma) |
Return a number distributed following a BreitWigner function with mean and gamma. More... | |
void | Circle (double &x, double &y, double r) |
Generates random vectors, uniformly distributed over a circle of given radius. Input : r = circle radius Output: x,y a random 2-d vector of length r. More... | |
double | Exp (double tau) |
Returns an exponential deviate. exp( -t/tau ) More... | |
double | GausACR (double mean, double sigma) |
generate random numbers according to the Accemptance-Complemet-Ratio method More... | |
double | GausBM (double mean, double sigma) |
generate Gaussian number using Box-Muller method More... | |
int | Poisson (double mean) |
Generate a random number following a Landau distribution with location parameter mu and scale parameter sigma: Landau( (x-mu)/sigma ) More... | |
double | PoissonD (double mean) |
void | Rannor (double &a, double &b) |
Generate numbers distributed following a gaussian with mean=0 and sigma=1. Using the Box-Muller method. More... | |
void | SetEngine (void *r) |
void | Sphere (double &x, double &y, double &z, double r) |
Generates random vectors, uniformly distributed over the surface of a sphere of given radius. More... | |
double | Uniform (double a) |
double | Uniform (double a, double b) |
generate random numbers following a Uniform distribution in the [a,b] interval More... | |
Protected Attributes | |
TRandomEngine * | fBaseEngine |
Private Member Functions | |
double | Gaus (double mean, double sigma) |
double | Rndm () |
|
inline |
class constructor
Definition at line 74 of file RandomFunctions.h.
int ROOT::Math::RandomFunctionsImpl< TRandomEngine >::Binomial | ( | int | ntot, |
double | prob | ||
) |
Generate binomial numbers.
double ROOT::Math::RandomFunctionsImpl< TRandomEngine >::BreitWigner | ( | double | mean, |
double | gamma | ||
) |
Return a number distributed following a BreitWigner function with mean and gamma.
void ROOT::Math::RandomFunctionsImpl< TRandomEngine >::Circle | ( | double & | x, |
double & | y, | ||
double | r | ||
) |
Generates random vectors, uniformly distributed over a circle of given radius. Input : r = circle radius Output: x,y a random 2-d vector of length r.
double ROOT::Math::RandomFunctionsImpl< TRandomEngine >::Exp | ( | double | tau | ) |
Returns an exponential deviate. exp( -t/tau )
|
inlineprivate |
Definition at line 132 of file RandomFunctions.h.
double ROOT::Math::RandomFunctionsImpl< TRandomEngine >::GausACR | ( | double | mean, |
double | sigma | ||
) |
generate random numbers according to the Accemptance-Complemet-Ratio method
double ROOT::Math::RandomFunctionsImpl< TRandomEngine >::GausBM | ( | double | mean, |
double | sigma | ||
) |
generate Gaussian number using Box-Muller method
int ROOT::Math::RandomFunctionsImpl< TRandomEngine >::Poisson | ( | double | mean | ) |
Generate a random number following a Landau distribution with location parameter mu and scale parameter sigma: Landau( (x-mu)/sigma )
Generates a random integer N according to a Poisson law. Prob(N) = exp(-mean)*mean^N/Factorial(N)
double ROOT::Math::RandomFunctionsImpl< TRandomEngine >::PoissonD | ( | double | mean | ) |
void ROOT::Math::RandomFunctionsImpl< TRandomEngine >::Rannor | ( | double & | a, |
double & | b | ||
) |
Generate numbers distributed following a gaussian with mean=0 and sigma=1. Using the Box-Muller method.
|
inlineprivate |
Definition at line 130 of file RandomFunctions.h.
References ROOT::Math::TRandomEngine::Rndm().
|
inline |
Definition at line 76 of file RandomFunctions.h.
void ROOT::Math::RandomFunctionsImpl< TRandomEngine >::Sphere | ( | double & | x, |
double & | y, | ||
double & | z, | ||
double | r | ||
) |
Generates random vectors, uniformly distributed over the surface of a sphere of given radius.
double ROOT::Math::RandomFunctionsImpl< TRandomEngine >::Uniform | ( | double | a | ) |
double ROOT::Math::RandomFunctionsImpl< TRandomEngine >::Uniform | ( | double | a, |
double | b | ||
) |
generate random numbers following a Uniform distribution in the [a,b] interval
|
protected |
Definition at line 126 of file RandomFunctions.h.