RanecuEngine


The algorithm originally written in FORTRAN77 as part of the MATHLIB HEP library.

The initialisation 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".

Seeds are taken from a seed table given an index, the getSeed() method returns the current index in the seed table, the getSeeds() method returns a pointer to the couple of seeds stored in the local table of seeds at the current index.

Author

Gabriele Cosmo

See also

Engines: HepRandomEngine, DRand48Engine , DualRand, HepJamesRandom, Hurd160Engine, Hurd288Engine, MTwistEngine, RandEngine, RanluxEngine, Ranlux64Engine, RanshiEngine, TripleRand

Distributions: HepRandom, RandBinomial, RandBit, RandBreitWigner, RandChiSquare, RandExponential, RandFlat, RandGamma, RandGauss, RandGaussQ, RandGaussT, RandGeneral, RandLandau, RandPoisson, RandPoissonQ, RandPoissonT, RandStudentT

Functions: HepStat

Declaration

#include "CLHEP/Random/RanecuEngine.h"

class RanecuEngine : public HepRandomEngine

Public Member Functions

Constructors
RanecuEngine()
RanecuEngine(HepInt index)
RanecuEngine(HepStd::istream& is)
Copy constructor
RanecuEngine(const RanecuEngine &p)
Destructor
virtual ~RanecuEngine()
Conversion operator
operator unsigned int()
32-bit int flat, faster in this case
=
RanecuEngine & operator = (const RanecuEngine &p)
Overloaded assignment operator, to retrieve the engine status.
flat
HepDouble flat()
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.
restoreStatus
void restoreStatus(const char filename[] = "Ranecu.conf")
Reads from file Ranecu.conf the last saved engine status and restores it.
saveStatus
void saveStatus(const char filename[] = "Ranecu.conf") const
Saves on file Ranecu.conf the current engine status.
setIndex
void setIndex (long index)
Sets the state of the algorithm according to index, the position in the local table of seeds.
setSeed
void setSeed (long index, HepInt dum=0)
Resets the state of the algorithm according to index, the position in the static table of seeds stored in HepRandom.
setSeeds
void setSeeds (const long* seeds, HepInt index)
Sets the state of the algorithm according to the array of seeds seeds containing two seed values to be stored in the local table at index position.
showStatus
void showStatus() const
Dumps the engine status on the screen.

Non-Member Functions

<<
HepStd::ostream & operator<< (HepStd::ostream & os, const RanecuEngine & e)
Output to a stream.
>>
HepStd::istream & operator>> (HepStd::istream & is, RanecuEngine & e)
Input from a stream.

Example

CLHEP/test/testRandom.cc


15 May 2000
EVC