00001 // @(#)root/mathcore:$Id: TRandom1.h 22866 2008-03-27 15:32:50Z rdm $ 00002 // Author: Rene Brun 04/03/99 00003 00004 /************************************************************************* 00005 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * 00006 * All rights reserved. * 00007 * * 00008 * For the licensing terms see $ROOTSYS/LICENSE. * 00009 * For the list of contributors see $ROOTSYS/README/CREDITS. * 00010 *************************************************************************/ 00011 00012 #ifndef ROOT_TRandom1 00013 #define ROOT_TRandom1 00014 00015 00016 00017 ////////////////////////////////////////////////////////////////////////// 00018 // // 00019 // TRandom1 // 00020 // // 00021 // Ranlux random number generator class (periodicity > 10**14) // 00022 // // 00023 ////////////////////////////////////////////////////////////////////////// 00024 00025 #ifndef ROOT_TRandom 00026 #include "TRandom.h" 00027 #endif 00028 00029 class TRandom1 : public TRandom { 00030 00031 protected: 00032 Int_t fNskip; 00033 Int_t fLuxury; 00034 Int_t fIlag; 00035 Int_t fJlag; 00036 Int_t fCount24; 00037 Float_t fFloatSeedTable[24]; 00038 Float_t fCarry; 00039 const Int_t fIntModulus; 00040 static Int_t fgNumEngines; 00041 static Int_t fgMaxIndex; 00042 const UInt_t *fTheSeeds; 00043 const Double_t fMantissaBit24; 00044 const Double_t fMantissaBit12; 00045 00046 public: 00047 TRandom1(); 00048 TRandom1(UInt_t seed, Int_t lux = 3 ); 00049 TRandom1(Int_t rowIndex, Int_t colIndex, Int_t lux ); 00050 virtual ~TRandom1(); 00051 virtual Int_t GetLuxury() const {return fLuxury;} 00052 // Gets the current seed. 00053 const UInt_t *GetTheSeeds() const {return fTheSeeds;} 00054 // Gets the current array of seeds. 00055 static void GetTableSeeds(UInt_t* seeds, Int_t index); 00056 // Gets back seed values stored in the table, given the index. 00057 virtual Double_t Rndm(Int_t i=0); 00058 virtual void RndmArray(Int_t size, Float_t *vect); 00059 virtual void RndmArray(Int_t size, Double_t *vect); 00060 virtual void SetSeed2(UInt_t seed, Int_t lux=3); 00061 // Sets the state of the algorithm according to seed. 00062 virtual void SetSeeds(const UInt_t * seeds, Int_t lux=3); 00063 // Sets the state of the algorithm according to the zero terminated 00064 // array of seeds. Only the first seed is used. 00065 virtual void SetSeed(UInt_t seed); 00066 00067 ClassDef(TRandom1,1) //Ranlux Random number generators with periodicity > 10**14 00068 }; 00069 00070 R__EXTERN TRandom *gRandom; 00071 00072 #endif