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.


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


#include "CLHEP/Random/RanecuEngine.h"

class RanecuEngine : public HepRandomEngine

Public Member Functions

RanecuEngine(HepInt index)
RanecuEngine(HepStd::istream& is)
Copy constructor
RanecuEngine(const RanecuEngine &p)
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.
HepDouble flat()
Returns a pseudo random number between 0 and 1, (excluding the end points).
void flatArray (const HepInt size, HepDouble* vect)
Fills the array vect of specified size with flat random values.
void restoreStatus(const char filename[] = "Ranecu.conf")
Reads from file Ranecu.conf the last saved engine status and restores it.
void saveStatus(const char filename[] = "Ranecu.conf") const
Saves on file Ranecu.conf the current engine status.
void setIndex (long index)
Sets the state of the algorithm according to index, the position in the local table of seeds.
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.
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.
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.



15 May 2000