ROOT  6.06/09
Reference Guide
TRandom1.h
Go to the documentation of this file.
1 // @(#)root/mathcore:$Id$
2 // Author: Rene Brun 04/03/99
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TRandom1
13 #define ROOT_TRandom1
14 
15 
16 
17 //////////////////////////////////////////////////////////////////////////
18 // //
19 // TRandom1 //
20 // //
21 // Ranlux random number generator class (periodicity > 10**14) //
22 // //
23 //////////////////////////////////////////////////////////////////////////
24 
25 #ifndef ROOT_TRandom
26 #include "TRandom.h"
27 #endif
28 
29 class TRandom1 : public TRandom {
30 
31 protected:
41  static Int_t fgMaxIndex;
42  const UInt_t *fTheSeeds;
45 
46 public:
47  TRandom1();
48  TRandom1(UInt_t seed, Int_t lux = 3 );
49  TRandom1(Int_t rowIndex, Int_t colIndex, Int_t lux );
50  virtual ~TRandom1();
51  virtual Int_t GetLuxury() const {return fLuxury;}
52  // Get the current seed (first element of the table)
53  virtual UInt_t GetSeed() const { return UInt_t ( fFloatSeedTable[0] / fMantissaBit24 ) ; }
54  // Gets the current seed.
55  const UInt_t *GetTheSeeds() const {return fTheSeeds;}
56  // Gets the current array of seeds.
57  static void GetTableSeeds(UInt_t* seeds, Int_t index);
58  // Gets back seed values stored in the table, given the index.
59  virtual Double_t Rndm(Int_t i=0);
60  virtual void RndmArray(Int_t size, Float_t *vect);
61  virtual void RndmArray(Int_t size, Double_t *vect);
62  virtual void SetSeed2(UInt_t seed, Int_t lux=3);
63  // Sets the state of the algorithm according to seed.
64  virtual void SetSeeds(const UInt_t * seeds, Int_t lux=3);
65  // Sets the state of the algorithm according to the zero terminated
66  // array of seeds. Only the first seed is used.
67  virtual void SetSeed(UInt_t seed);
68 
69  ClassDef(TRandom1,1) //Ranlux Random number generators with periodicity > 10**14
70 };
71 
73 
74 #endif
const UInt_t * fTheSeeds
Definition: TRandom1.h:42
Int_t fIlag
Definition: TRandom1.h:34
virtual void SetSeed2(UInt_t seed, Int_t lux=3)
The initialisation is carried out using a Multiplicative Congruential generator using formula constan...
Definition: TRandom1.cxx:555
float Float_t
Definition: RtypesCore.h:53
virtual void RndmArray(Int_t size, Float_t *vect)
return an array of random numbers in ]0,1]
Definition: TRandom1.cxx:413
Float_t fCarry
Definition: TRandom1.h:38
const Int_t fIntModulus
Definition: TRandom1.h:39
virtual void SetSeeds(const UInt_t *seeds, Int_t lux=3)
set seeds
Definition: TRandom1.cxx:478
int Int_t
Definition: RtypesCore.h:41
The Ranlux Random number generator class.
Definition: TRandom1.h:29
#define ClassDef(name, id)
Definition: Rtypes.h:254
virtual void SetSeed(UInt_t seed)
Set the random generator seed.
Definition: TRandom1.cxx:619
This is the base class for the ROOT Random number generators.
Definition: TRandom.h:29
TRandom1()
default constructor
Definition: TRandom1.cxx:287
virtual ~TRandom1()
destructor
Definition: TRandom1.cxx:341
const UInt_t * GetTheSeeds() const
Definition: TRandom1.h:55
Int_t fCount24
Definition: TRandom1.h:36
Int_t fJlag
Definition: TRandom1.h:35
const Double_t fMantissaBit12
Definition: TRandom1.h:44
Int_t fLuxury
Definition: TRandom1.h:33
virtual Int_t GetLuxury() const
Definition: TRandom1.h:51
unsigned int UInt_t
Definition: RtypesCore.h:42
const Double_t fMantissaBit24
Definition: TRandom1.h:43
Float_t fFloatSeedTable[24]
Definition: TRandom1.h:37
double Double_t
Definition: RtypesCore.h:55
static Int_t fgNumEngines
Definition: TRandom1.h:40
#define R__EXTERN
Definition: DllImport.h:27
R__EXTERN TRandom * gRandom
Definition: TRandom1.h:72
virtual UInt_t GetSeed() const
Definition: TRandom1.h:53
static void GetTableSeeds(UInt_t *seeds, Int_t index)
static function returning the table of seeds
Definition: TRandom1.cxx:348
static Int_t fgMaxIndex
Definition: TRandom1.h:41
Int_t fNskip
Definition: TRandom1.h:32
virtual Double_t Rndm(Int_t i=0)
return a random number in ]0,1]
Definition: TRandom1.cxx:360