Exclusive or of a feedback shift register and integer congruence
random number generator. The feedback shift register uses offsets
127 and 97. The integer congruence generator uses a different
multiplier for each stream. The multipliers are chosen to give
full period and maximum "potency" for modulo 2^32. The period of
the combined random number generator is 2^159 - 2^32, and the
sequences are different for each stream (not just started in a
different place).
Author
Doug Toussaint
See also
Engines:
HepRandomEngine,
DRand48Engine ,
HepJamesRandom
Hurd160Engine
Hurd288Engine
MTwistEngine
RandEngine
RanecuEngine
RanluxEngine
Ranlux64Engine
RanshiEngine
TripleRand
Distributions:
HepRandom,
RandBinomial
RandBreitWigner
RandChiSquare
RandExponential
RandFlat
RandGamma
RandGauss
RandGeneral
RandPoisson
RandStudentT
Declaration
#include "CLHEP/Random/DualRand.h"
class DualRand: public HepRandomEngine
Public Member Functions
- Constructors
- DualRand()
- DualRand(long seed)
- DualRand(HepInt rowIndex, HepInt colIndex)
- DualRand(std::istream& is)
- Copy constructor
- DualRand(const DualRand & p)
- Destructor
- virtual ~DualRand()
- Conversion operators
- operator HepFloat()
- Flat value, without worrying about filling bits
- operator unsigned int()
- 32-bit flat value, quickest of all
- =
- DualRand & operator=(const DualRand & p)
- Assignment
- 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 an array vect of specified size with flat random values.
- restoreStatus
- void restoreStatus(const char filename[] = "DualRand.conf")
- Reads from named file the last saved engine status and restores it.
- saveStatus
- void saveStatus(const char filename[] = "DualRand.conf") const
- Saves on named file the current engine status.
- setSeed
- void setSeed(long seed, HepInt)
- Sets the state of the algorithm according to seed.
- setSeeds
- void setSeeds(const long * seeds, HepInt)
- Sets the state of the algorithm according to the zero-terminated
array of seeds.
- showStatus
- void showStatus() const
- Dumps the current engine status on the screen.
Non-Member Functions
- <<
- std::ostream & operator<< (std::ostream & os,
const DualRand & e)
- Output to a stream.
- >>
- std::istream & operator>> (std::istream & is,
DualRand & e)
- Input from a stream.
Example
CLHEP/test/testRandom.cc
04 May 1999
EVC