Logo ROOT  
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#include "TRandom.h"
26
27class TRandom1 : public TRandom {
28
29protected:
43
44public:
45 TRandom1();
46 TRandom1(UInt_t seed, Int_t lux = 3 );
47 TRandom1(Int_t rowIndex, Int_t colIndex, Int_t lux );
48 virtual ~TRandom1();
49 virtual Int_t GetLuxury() const {return fLuxury;}
50 // Get the current seed (first element of the table)
51 virtual UInt_t GetSeed() const { return UInt_t ( fFloatSeedTable[0] / fMantissaBit24 ) ; }
52 // Gets the current seed.
53 const UInt_t *GetTheSeeds() const {return fTheSeeds;}
54 // Gets the current array of seeds.
55 static void GetTableSeeds(UInt_t* seeds, Int_t index);
56 // Gets back seed values stored in the table, given the index.
57 using TRandom::Rndm;
58 virtual Double_t Rndm( );
59 virtual void RndmArray(Int_t size, Float_t *vect);
60 virtual void RndmArray(Int_t size, Double_t *vect);
61 virtual void SetSeed2(UInt_t seed, Int_t lux=3);
62 // Sets the state of the algorithm according to seed.
63 virtual void SetSeeds(const UInt_t * seeds, Int_t lux=3);
64 // Sets the state of the algorithm according to the zero terminated
65 // array of seeds. Only the first seed is used.
66 virtual void SetSeed(ULong_t seed);
67
68 ClassDef(TRandom1,1) //Ranlux Random number generators with periodicity > 10**14
69};
70
72
73#endif
#define R__EXTERN
Definition: DllImport.h:27
int Int_t
Definition: RtypesCore.h:41
unsigned int UInt_t
Definition: RtypesCore.h:42
unsigned long ULong_t
Definition: RtypesCore.h:51
double Double_t
Definition: RtypesCore.h:55
float Float_t
Definition: RtypesCore.h:53
#define ClassDef(name, id)
Definition: Rtypes.h:326
R__EXTERN TRandom * gRandom
Definition: TRandom1.h:71
The Ranlux Random number generator class.
Definition: TRandom1.h:27
const Double_t fMantissaBit12
Definition: TRandom1.h:42
Float_t fFloatSeedTable[24]
Definition: TRandom1.h:35
TRandom1()
default constructor
Definition: TRandom1.cxx:287
Int_t fIlag
Definition: TRandom1.h:32
Int_t fNskip
Definition: TRandom1.h:30
Int_t fCount24
Definition: TRandom1.h:34
const UInt_t * fTheSeeds
Definition: TRandom1.h:40
Int_t fJlag
Definition: TRandom1.h:33
virtual Double_t Rndm()
return a random number in ]0,1]
Definition: TRandom1.cxx:360
static Int_t fgMaxIndex
Definition: TRandom1.h:39
virtual Int_t GetLuxury() const
Definition: TRandom1.h:49
const UInt_t * GetTheSeeds() const
Definition: TRandom1.h:53
Float_t fCarry
Definition: TRandom1.h:36
const Double_t fMantissaBit24
Definition: TRandom1.h:41
virtual ~TRandom1()
destructor
Definition: TRandom1.cxx:341
const Int_t fIntModulus
Definition: TRandom1.h:37
virtual void SetSeeds(const UInt_t *seeds, Int_t lux=3)
set seeds
Definition: TRandom1.cxx:478
virtual void RndmArray(Int_t size, Float_t *vect)
return an array of random numbers in ]0,1]
Definition: TRandom1.cxx:413
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
static void GetTableSeeds(UInt_t *seeds, Int_t index)
static function returning the table of seeds
Definition: TRandom1.cxx:348
virtual void SetSeed(ULong_t seed)
Set the random generator seed.
Definition: TRandom1.cxx:619
virtual UInt_t GetSeed() const
Definition: TRandom1.h:51
static Int_t fgNumEngines
Definition: TRandom1.h:38
Int_t fLuxury
Definition: TRandom1.h:31
This is the base class for the ROOT Random number generators.
Definition: TRandom.h:27
virtual Double_t Rndm()
Machine independent random number generator.
Definition: TRandom.cxx:541
static constexpr double lux