The algorithm for this random engine has been taken from the notes of
a double-precision ranlux implementation by Martin Luscher, dated
November 1997.
Like the previous Ranlux
generator, this one also has "luxury" levels,
determining how many pseudo-random numbers are discarded for every
twelve values used. Three levels are given, with the note that Luscher
himself advocates only the highest two levels for this engine.
- level 0 (p=109): Throw away 109 values for every 12 used
- level 1 (p=202): Throw away 202 values for every 12 used (default)
- level 2 (p=397): Throw away 397 values for every 12 used
The initialization is carried out using a Multiplicative Congruential
generator using formula constants of L'Ecuyer as described in "F.James,
Comp. Phys. Comm. 60 (1990) 329-344".
Author
Ken Smith
See also
Engines:
HepRandomEngine,
DRand48Engine ,
DualRand
HepJamesRandom
Hurd160Engine
Hurd288Engine
MTwistEngine
RandEngine
RanecuEngine
RanluxEngine
RanshiEngine
TripleRand
Distributions:
HepRandom,
RandBinomial
RandBreitWigner
RandChiSquare
RandExponential
RandFlat
RandGamma
RandGauss
RandGeneral
RandPoisson
RandStudentT
Declaration
#include "CLHEP/Random/Ranlux64Engine.h"
class Ranlux64Engine : public HepRandomEngine
Public Member Functions
- Constructors
- Ranlux64Engine()
- Ranlux64Engine(std::istream& is)
- Ranlux64Engine(long seed, HepInt lux = 1)
- Ranlux64Engine(HepInt rowIndex, HepInt colIndex, HepInt lux)
- Copy constructor
- Ranlux64Engine(const Ranlux64Engine &p)
- Destructor
- virtual ~Ranlux64Engine()
- =
- Ranlux64Engine & operator = (const Ranlux64Engine &p)
- Overloaded assignment operator, to retrieve the engine status.
- flat
- HepDouble flat()
- It returns a pseudo random number between 0 and 1,
excluding the end points.
- flatArray
- void flatArray (const HepInt size, HepDouble* vect)
- Fills the array vect of specified size with flat random values.
- getLuxury
- HepInt getLuxury() const
- Gets the luxury level.
- restoreStatus
- void restoreStatus(const char filename[] = "Ranlux64.conf")
- Reads from named file the last saved engine status and restores it
- saveStatus
- void saveStatus(const char filename[] = "Ranlux64.conf") const
- Saves in named file the current engine status.
- setSeed
- void setSeed(long seed, HepInt lux=1)
- Sets the state of the algorithm according to seed.
- setSeeds
- void setSeeds(const long * seeds, HepInt lux=1)
- Sets the state of the algorithm according to the zero terminated
array of seeds. Only the first seed is used.
- showStatus
- void showStatus() const
- Dumps the engine status on the screen.
Non-Member Functions
- <<
- std::ostream & operator<< (std::ostream & os,
const Ranlux64Engine & e)
- Output to a stream.
- >>
- std::istream & operator>> (std::istream & is,
Ranlux64Engine & e)
- Input from a stream.
Example
CLHEP/test/testRandom.cc
04 May 1999
EVC