Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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:
40 const UInt_t *fTheSeeds; //! Temporary array of seed values (transient)
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 ~TRandom1() override;
49 /////////////////////////////////////////////////////////////////////////////
50 /// Returns current luxury value.
51 virtual Int_t GetLuxury() const {return fLuxury;}
52 /////////////////////////////////////////////////////////////////////////////
53 /// Returns the current seed (first element of the seed table)
54 /// \warning This is not the initial seed!
55 UInt_t GetSeed() const override { return UInt_t ( fFloatSeedTable[0] / fMantissaBit24 ) ; }
56 /////////////////////////////////////////////////////////////////////////////
57 /// Returns the pointer to the current seeds array.
58 const UInt_t *GetTheSeeds() const {return fTheSeeds;}
59 /////////////////////////////////////////////////////////////////////////////
60 /// Returns an array of seed values stored in the table, given the index.
61 static void GetTableSeeds(UInt_t *seeds, Int_t index);
62 using TRandom::Rndm;
63 Double_t Rndm() override;
64 void RndmArray(Int_t size, Float_t *vect) override;
65 void RndmArray(Int_t size, Double_t *vect) override;
66 virtual void SetSeed2(UInt_t seed, Int_t lux = 3);
67 // Sets the state of the algorithm according to seed.
68 virtual void SetSeeds(const UInt_t *seeds, Int_t lux = 3);
69 // Sets the state of the algorithm according to the zero terminated
70 // array of seeds. Only the first seed is used.
71 void SetSeed(ULong_t seed) override;
72
73 ClassDefOverride(TRandom1,2) //Ranlux Random number generators with periodicity > 10**14
74};
75
77
78#endif
#define R__EXTERN
Definition DllImport.h:27
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
int Int_t
Definition RtypesCore.h:45
unsigned long ULong_t
Definition RtypesCore.h:55
unsigned int UInt_t
Definition RtypesCore.h:46
float Float_t
Definition RtypesCore.h:57
double Double_t
Definition RtypesCore.h:59
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
R__EXTERN TRandom * gRandom
Definition TRandom1.h:76
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:286
Int_t fIlag
Definition TRandom1.h:32
void RndmArray(Int_t size, Float_t *vect) override
Returns an array of random numbers in ]0,1].
Definition TRandom1.cxx:407
Int_t fNskip
Definition TRandom1.h:30
Int_t fCount24
Definition TRandom1.h:34
~TRandom1() override
Destructor.
Definition TRandom1.cxx:338
Double_t Rndm() override
Returns a random number in ]0,1].
Definition TRandom1.cxx:355
const UInt_t * fTheSeeds
Definition TRandom1.h:40
Int_t fJlag
Definition TRandom1.h:33
static Int_t fgMaxIndex
Definition TRandom1.h:39
void SetSeed(ULong_t seed) override
Set the state of the generator providing a single seed value and using the luxury level defined when ...
Definition TRandom1.cxx:595
virtual Int_t GetLuxury() const
Returns current luxury value.
Definition TRandom1.h:51
const UInt_t * GetTheSeeds() const
Returns the pointer to the current seeds array.
Definition TRandom1.h:58
UInt_t GetSeed() const override
Returns the current seed (first element of the seed table)
Definition TRandom1.h:55
Float_t fCarry
Definition TRandom1.h:36
const Double_t fMantissaBit24
Temporary array of seed values (transient)
Definition TRandom1.h:41
const Int_t fIntModulus
Definition TRandom1.h:37
virtual void SetSeeds(const UInt_t *seeds, Int_t lux=3)
Set the state of the generator providing an array of seeds.
Definition TRandom1.cxx:481
virtual void SetSeed2(UInt_t seed, Int_t lux=3)
Set the state of the generator providing a single seed value and a luxury level.
Definition TRandom1.cxx:563
static void GetTableSeeds(UInt_t *seeds, Int_t index)
Returns an array of seed values stored in the table, given the index.
Definition TRandom1.cxx:344
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
Double_t Rndm() override
Machine independent random number generator.
Definition TRandom.cxx:559