Logo ROOT   6.08/07
Reference Guide
TRandom3.h
Go to the documentation of this file.
1 // @(#)root/mathcore:$Id$
2 // Author: Peter Malzacher 31/08/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_TRandom3
13 #define ROOT_TRandom3
14 
15 
16 
17 //////////////////////////////////////////////////////////////////////////
18 // //
19 // TRandom3 //
20 // //
21 // random number generator class: Mersenne Twister //
22 // //
23 //////////////////////////////////////////////////////////////////////////
24 
25 #ifndef ROOT_TRandom
26 #include "TRandom.h"
27 #endif
28 
29 class TRandom3 : public TRandom {
30 
31 private:
32  UInt_t fMt[624];
34 
35 public:
36  TRandom3(UInt_t seed=4357);
37  virtual ~TRandom3();
38  // get the current seed (only first element of the seed table)
39  virtual UInt_t GetSeed() const { return fMt[0];}
40  using TRandom::Rndm;
41  virtual Double_t Rndm( );
42  virtual void RndmArray(Int_t n, Float_t *array);
43  virtual void RndmArray(Int_t n, Double_t *array);
44  virtual void SetSeed(ULong_t seed=0);
45 
46  ClassDef(TRandom3,2) //Random number generator: Mersenne Twister
47 };
48 
50 
51 #endif
virtual UInt_t GetSeed() const
Definition: TRandom3.h:39
Random number generator class based on M.
Definition: TRandom3.h:29
virtual Double_t Rndm()
Machine independent random number generator.
Definition: TRandom3.cxx:94
float Float_t
Definition: RtypesCore.h:53
virtual ~TRandom3()
-*-*-*-*-*-*-*-*-*-*default destructor-*-*-*-*-*-*-*-*-*-*-*-*-*-* *-* ================== ...
Definition: TRandom3.cxx:85
virtual void SetSeed(ULong_t seed=0)
Set the random generator sequence if seed is 0 (default value) a TUUID is generated and used to fill ...
Definition: TRandom3.cxx:201
int Int_t
Definition: RtypesCore.h:41
#define ClassDef(name, id)
Definition: Rtypes.h:254
This is the base class for the ROOT Random number generators.
Definition: TRandom.h:31
R__EXTERN TRandom * gRandom
Definition: TRandom3.h:49
virtual Double_t Rndm()
Machine independent random number generator.
Definition: TRandom.cxx:512
unsigned int UInt_t
Definition: RtypesCore.h:42
virtual void RndmArray(Int_t n, Float_t *array)
Return an array of n random numbers uniformly distributed in ]0,1].
Definition: TRandom3.cxx:138
double Double_t
Definition: RtypesCore.h:55
Int_t fCount624
Definition: TRandom3.h:33
TRandom3(UInt_t seed=4357)
-*-*-*-*-*-*-*-*-*-*default constructor-*-*-*-*-*-*-*-*-*-*-*-*-*-* If seed is 0, the seed is automat...
Definition: TRandom3.cxx:74
unsigned long ULong_t
Definition: RtypesCore.h:51
#define R__EXTERN
Definition: DllImport.h:27
UInt_t fMt[624]
Definition: TRandom3.h:32
const Int_t n
Definition: legend1.C:16