ROOT logo
// @(#)root/mathcore:$Id: TRandom1.h 39600 2011-06-08 13:04:37Z moneta $
// Author: Rene Brun   04/03/99

/*************************************************************************
 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TRandom1
#define ROOT_TRandom1



//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TRandom1                                                             //
//                                                                      //
// Ranlux random number generator class (periodicity > 10**14)          //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#ifndef ROOT_TRandom
#include "TRandom.h"
#endif

class TRandom1 : public TRandom {

protected:
  Int_t           fNskip;
  Int_t           fLuxury;
  Int_t           fIlag;
  Int_t           fJlag;
  Int_t           fCount24;
  Float_t         fFloatSeedTable[24];
  Float_t         fCarry;
  const Int_t     fIntModulus;
  static Int_t    fgNumEngines;
  static Int_t    fgMaxIndex;
  const UInt_t   *fTheSeeds;
  const Double_t  fMantissaBit24;
  const Double_t  fMantissaBit12;

public:
   TRandom1();
   TRandom1(UInt_t seed, Int_t lux = 3 );
   TRandom1(Int_t rowIndex, Int_t colIndex, Int_t lux );
   virtual ~TRandom1();
   virtual  Int_t    GetLuxury() const {return fLuxury;}
                    // Get the current seed (first element of the table)
   virtual  UInt_t   GetSeed() const { return  UInt_t ( fFloatSeedTable[0] /  fMantissaBit24 ) ; }
                    // Gets the current seed.
   const UInt_t     *GetTheSeeds() const {return fTheSeeds;}
                     // Gets the current array of seeds.
   static   void     GetTableSeeds(UInt_t* seeds, Int_t index);
                     // Gets back seed values stored in the table, given the index.
   virtual  Double_t Rndm(Int_t i=0);
   virtual  void     RndmArray(Int_t size, Float_t *vect);
   virtual  void     RndmArray(Int_t size, Double_t *vect);
   virtual  void     SetSeed2(UInt_t seed, Int_t lux=3);
                     // Sets the state of the algorithm according to seed.
   virtual  void     SetSeeds(const UInt_t * seeds, Int_t lux=3);
                     // Sets the state of the algorithm according to the zero terminated
                     // array of seeds. Only the first seed is used.
   virtual  void     SetSeed(UInt_t seed);

   ClassDef(TRandom1,1)  //Ranlux Random number generators with periodicity > 10**14
};

R__EXTERN TRandom *gRandom;

#endif
 TRandom1.h:1
 TRandom1.h:2
 TRandom1.h:3
 TRandom1.h:4
 TRandom1.h:5
 TRandom1.h:6
 TRandom1.h:7
 TRandom1.h:8
 TRandom1.h:9
 TRandom1.h:10
 TRandom1.h:11
 TRandom1.h:12
 TRandom1.h:13
 TRandom1.h:14
 TRandom1.h:15
 TRandom1.h:16
 TRandom1.h:17
 TRandom1.h:18
 TRandom1.h:19
 TRandom1.h:20
 TRandom1.h:21
 TRandom1.h:22
 TRandom1.h:23
 TRandom1.h:24
 TRandom1.h:25
 TRandom1.h:26
 TRandom1.h:27
 TRandom1.h:28
 TRandom1.h:29
 TRandom1.h:30
 TRandom1.h:31
 TRandom1.h:32
 TRandom1.h:33
 TRandom1.h:34
 TRandom1.h:35
 TRandom1.h:36
 TRandom1.h:37
 TRandom1.h:38
 TRandom1.h:39
 TRandom1.h:40
 TRandom1.h:41
 TRandom1.h:42
 TRandom1.h:43
 TRandom1.h:44
 TRandom1.h:45
 TRandom1.h:46
 TRandom1.h:47
 TRandom1.h:48
 TRandom1.h:49
 TRandom1.h:50
 TRandom1.h:51
 TRandom1.h:52
 TRandom1.h:53
 TRandom1.h:54
 TRandom1.h:55
 TRandom1.h:56
 TRandom1.h:57
 TRandom1.h:58
 TRandom1.h:59
 TRandom1.h:60
 TRandom1.h:61
 TRandom1.h:62
 TRandom1.h:63
 TRandom1.h:64
 TRandom1.h:65
 TRandom1.h:66
 TRandom1.h:67
 TRandom1.h:68
 TRandom1.h:69
 TRandom1.h:70
 TRandom1.h:71
 TRandom1.h:72
 TRandom1.h:73
 TRandom1.h:74