39 SetTitle(
"Random number generator with period of about 10**26");
58 #define TAUSWORTHE(s,a,b,c,d) (((s &c) <<d) & 0xffffffffUL ) ^ ((((s <<a) & 0xffffffffUL )^s) >>b) 61 const double kScale = 2.3283064365386963e-10;
68 if (iy)
return kScale*
static_cast<Double_t
>(iy);
77 const double kScale = 2.3283064365386963e-10;
81 for(Int_t i=0; i<n; i++) {
87 if (iy) array[i] = (Float_t)(kScale*static_cast<Double_t>(iy));
88 else array[i] =
Rndm();
97 const double kScale = 2.3283064365386963e-10;
100 for(Int_t i=0; i<n; i++) {
106 if (iy) array[i] = kScale*
static_cast<Double_t
>(iy);
107 else array[i] =
Rndm();
122 #define LCG(n) ((69069 * n) & 0xffffffffUL) // linear congurential generator 136 fSeed = UInt_t(uuid[3])*16777216 + UInt_t(uuid[2])*65536 + UInt_t(uuid[1])*256 + UInt_t(uuid[0]);
137 fSeed1 = UInt_t(uuid[7])*16777216 + UInt_t(uuid[6])*65536 + UInt_t(uuid[5])*256 + UInt_t(uuid[4]);
138 fSeed2 = UInt_t(uuid[11])*16777216 + UInt_t(uuid[10])*65536 + UInt_t(uuid[9])*256 + UInt_t(uuid[8]);
140 UInt_t seed3 = UInt_t(uuid[15])*16777216 + UInt_t(uuid[14])*65536 + UInt_t(uuid[13])*256 + UInt_t(uuid[12]);
155 for (
int i = 0; i < 6; ++i)
Random number generator class based on the maximally quidistributed combined Tausworthe generator by ...
virtual void SetSeed(ULong_t seed=0)
Set the generator seed.
virtual ~TRandom2()
Default destructor.
virtual void RndmArray(Int_t n, Float_t *array)
Return an array of n random numbers uniformly distributed in ]0,1].
virtual Double_t Rndm()
TausWorth generator from L'Ecuyer, uses as seed 3x32bits integers Use a mask of 0xffffffffUL to make ...
TRandom2(UInt_t seed=1)
Default constructor.
#define TAUSWORTHE(s, a, b, c, d)