Package de.gsi.math
Class TRandom1
- java.lang.Object
-
- de.gsi.math.TRandom
-
- de.gsi.math.TRandom1
-
public class TRandom1 extends TRandom
-
-
Field Summary
Fields Modifier and Type Field Description protected floatfCarryprotected intfCount24protected float[]fFloatSeedTableprotected static intfgMaxIndexprotected static intfgNumEnginesprotected intfIlagprotected intfIntModulusprotected intfJlagprotected intfLuxuryprotected doublefMantissaBit12protected doublefMantissaBit24protected intfNskipprotected longfTheSeeds
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doubleRndm(int rnd)return a random number in ]0,1]voidRndmArray(int size, double[] vect)return an array of random numbers in ]0,1]voidRndmArray(int size, float[] vect)return an array of random numbers in ]0,1]voidSetSeed(long seed)Set RanLux seed using default luxury levelvoidSetSeed2(long seed, int lux)The initialisation is carried out using a Multiplicative Congruential generator using formula constants of L'Ecuyer as described in "A review of pseudorandom number generators" (Fred James) published in Computer Physics Communications 60 (1990) pages 329-344voidSetSeeds(long seeds, int lux)set seeds
-
-
-
Field Detail
-
fgNumEngines
protected static int fgNumEngines
-
fgMaxIndex
protected static int fgMaxIndex
-
fNskip
protected int fNskip
-
fLuxury
protected int fLuxury
-
fIlag
protected int fIlag
-
fJlag
protected int fJlag
-
fCount24
protected int fCount24
-
fFloatSeedTable
protected float[] fFloatSeedTable
-
fCarry
protected float fCarry
-
fIntModulus
protected final int fIntModulus
-
fTheSeeds
protected final long fTheSeeds
-
fMantissaBit24
protected final double fMantissaBit24
-
fMantissaBit12
protected final double fMantissaBit12
-
-
Constructor Detail
-
TRandom1
public TRandom1()
default constructor
-
TRandom1
public TRandom1(long seed, int lux)Luxury level is set in the same way as the original FORTRAN routine. level 0 (p=24): equivalent to the original RCARRY of Marsaglia and Zaman, very long period, but fails many tests. level 1 (p=48): considerable improvement in quality over level 0, now passes the gap test, but still fails spectral test. level 2 (p=97): passes all known tests, but theoretically still defective. level 3 (p=223): DEFAULT VALUE. Any theoretically possible correlations have very small chance of being observed. level 4 (p=389): highest possible luxury, all 24 bits chaotic.- Parameters:
seed- initial seedlux- initial luxury
-
-
Method Detail
-
Rndm
public double Rndm(int rnd)
return a random number in ]0,1]- Parameters:
rnd- empty seed- Returns:
- random number in ]0,1]
-
RndmArray
public void RndmArray(int size, double[] vect)return an array of random numbers in ]0,1]- Parameters:
size- size of storage vectorvect- storage vector
-
RndmArray
public void RndmArray(int size, float[] vect)return an array of random numbers in ]0,1]
-
SetSeed
public void SetSeed(long seed)
Set RanLux seed using default luxury level
-
SetSeed2
public void SetSeed2(long seed, int lux)The initialisation is carried out using a Multiplicative Congruential generator using formula constants of L'Ecuyer as described in "A review of pseudorandom number generators" (Fred James) published in Computer Physics Communications 60 (1990) pages 329-344- Parameters:
seed- initial seedlux- initial luxury
-
SetSeeds
public void SetSeeds(long seeds, int lux)set seeds- Parameters:
seeds- initial seedlux- initial luxury
-
-