public class TRandom extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static long |
fSeed |
| Constructor and Description |
|---|
TRandom(long seed)
default constructor
|
| Modifier and Type | Method and Description |
|---|---|
int |
Binomial(int ntot,
double prob) |
double |
BreitWigner(double mean,
double gamma)
Return a number distributed following a BreitWigner function with mean and gamma
|
void |
Circle(double[] val,
double r)
generates random vectors, uniformly distributed over a circle of given radius.
|
double |
Exp(double tau) |
double |
Gaus(double mean,
double sigma)
samples a random number from the standard Normal (Gaussian) Distribution with the given mean and sigma.
|
long |
Integer(long imax)
returns a random integer on [ 0, imax-1 ].
|
double |
Landau(double mpv,
double sigma)
Generate a random number following a Landau distribution with mpv(most probable value) and sigma Converted by
Rene Brun from CERNLIB routine ranlan(G110)
|
int |
Poisson(double mean)
Generates a random integer N according to a Poisson law.
|
double |
PoissonD(double mean)
Generates a random number according to a Poisson law.
|
void |
Rannor(double[] val)
Return 2 numbers distributed following a gaussian with mean=0 and sigma=1
|
void |
Rannor(float[] val)
Return 2 numbers distributed following a gaussian with mean=0 and sigma=1
|
double |
Rndm()
Machine independent random number generator.
|
void |
RndmArray(int n,
float[] array)
Return an array of n random numbers uniformly distributed in ]0,1]
|
void |
SetSeed(long seed)
Set the random generator seed if seed is zero, the seed is set to the current machine clock Note that the machine
clock is returned with a precision of 1 second.
|
void |
Sphere(double[] val,
double r)
generates random vectors, uniformly distributed over the surface of a sphere of given radius.
|
String |
toString() |
double |
Uniform(double x1)
returns a uniform deviate on the interval ]0, x1].
|
double |
Uniform(double x1,
double x2)
returns a uniform deviate on the interval ]x1, x2].
|
public TRandom(long seed)
seed - initial seedpublic int Binomial(int ntot,
double prob)
public double BreitWigner(double mean,
double gamma)
mean - center of Breit-Wigner distributiongamma - width of Breit-Wigner distributionpublic void Circle(double[] val,
double r)
val - [0], [1] a random 2-d vector of length rr - circle radiuspublic double Exp(double tau)
tau - parameterpublic double Gaus(double mean,
double sigma)
mean - centre of Gauss functionsigma - width of Gauss functionpublic long Integer(long imax)
imax - max rangepublic double Landau(double mpv,
double sigma)
mpv - parameter of Landau distributionsigma - parameter of Landau distributionpublic int Poisson(double mean)
mean - centre of distributionpublic double PoissonD(double mean)
mean - centre of distributionpublic void Rannor(double[] val)
val - storage vector for Gaussian distributed random numberspublic void Rannor(float[] val)
val - storage vector for Rannor distributed random numberspublic double Rndm()
public void RndmArray(int n,
float[] array)
n - length of arrayarray - storage arraypublic void SetSeed(long seed)
seed - initial seedpublic void Sphere(double[] val,
double r)
val - [0], [1], [2] a random 3-d vector of length rr - sphere radiuspublic double Uniform(double x1)
x1 - maximum rangepublic double Uniform(double x1,
double x2)
x1 - minimum rangex2 - maximum rangeCopyright © 2020 GSI Helmholtzzentrum für Schwerionenforschung GmbH. All rights reserved.