library: libCore #include "TRandom3.h" |
TRandom3
class description - header file - source file - inheritance tree (.pdf)
public:
TRandom3(UInt_t seed = 4357)
TRandom3(const TRandom3&)
virtual ~TRandom3()
static TClass* Class()
virtual TClass* IsA() const
TRandom3& operator=(const TRandom3&)
virtual Double_t Rndm(Int_t i = 0)
virtual void RndmArray(Int_t n, Float_t* array)
virtual void RndmArray(Int_t n, Double_t* array)
virtual void SetSeed(UInt_t seed = 0)
virtual void ShowMembers(TMemberInspector& insp, char* parent)
virtual void Streamer(TBuffer& b)
void StreamerNVirtual(TBuffer& b)
private:
UInt_t fMt[624]
Int_t fCount624
TRandom3
Random number generator class based on
M. Matsumoto and T. Nishimura,
Mersenne Twistor: A 623-diminsionally equidistributed
uniform pseudorandom number generator
ACM Transactions on Modeling and Computer Simulation,
Vol. 8, No. 1, January 1998, pp 3--30.
For more information see the Mersenne Twistor homepage
http://www.math.keio.ac.jp/~matumoto/emt.html
Advantage: large period 2**19937-1
relativly fast
(only two times slower than TRandom, but
two times faster than TRandom2)
Drawback: a relative large internal state of 624 integers
Aug.99 ROOT implementation based on CLHEP by P.Malzacher
the original code contains the following copyright notice:
This library is free software; you can redistribute it and/or
TRandom3(UInt_t seed)
*-*-*-*-*-*-*-*-*-*-*default constructor*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
If seed is 0, the seed is automatically computed via a TUUID object.
In this case the seed is guaranteed to be unique in space and time.
~TRandom3()
*-*-*-*-*-*-*-*-*-*-*default destructor*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-* ==================
Double_t Rndm(Int_t)
Machine independent random number generator.
Produces uniformly-distributed floating points in ]0,1]
Method: Mersenne Twistor
void RndmArray(Int_t n, Float_t *array)
Return an array of n random numbers uniformly distributed in ]0,1]
void SetSeed(UInt_t seed)
Set the random generator sequence
if seed is 0 (default value) a TUUID is generated and used to fill
the first 8 integers of the seed array.
In this case the seed is guaranteed to be unique in space and time.
Use upgraded seeding procedure to fix a known problem when seeding with values
with many zero in the bit pattern (like 2**28).
see http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/emt19937ar.html
Author: Peter Malzacher 31/08/99
Last update: root/base:$Name: $:$Id: TRandom3.cxx,v 1.14 2006/06/16 13:05:33 brun Exp $
ROOT page - Class index - Class Hierarchy - Top of the page
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.