Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
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 #include "TRandom.h"
26 
27 class TRandom3 : public TRandom {
28 
29 private:
30  UInt_t fMt[624];
31  Int_t fCount624;
32 
33 public:
34  TRandom3(UInt_t seed=4357);
35  virtual ~TRandom3();
36  // get the current seed (only first element of the seed table)
37  virtual UInt_t GetSeed() const { return fMt[0];}
38  using TRandom::Rndm;
39  virtual Double_t Rndm( );
40  virtual void RndmArray(Int_t n, Float_t *array);
41  virtual void RndmArray(Int_t n, Double_t *array);
42  virtual void SetSeed(ULong_t seed=0);
43 
44  ClassDef(TRandom3,2) //Random number generator: Mersenne Twister
45 };
46 
47 R__EXTERN TRandom *gRandom;
48 
49 #endif