The starting point for the Hurd Random algorithm is the paper in IEEE Transactions on Computers c23, 2 Feb 1974. The algorithm is essentially a series of 32 interconnected b-bit registers. The basic property is that at each step, bit 1 becomes bit 0, bit 2 the new bit 1, bit b the new bit b-1. This is modified so that the new bit b0 is the old bit b1 XOR'd with some bit b-d from the previous bit register. The values of d can be chosen so as to generate a primitive polynomial, a maximal length sequence through all bit patterns except the zero pattern.

This generator, Hurd288, use values based upon Table I of the afore mentioned paper, such that we have 288 total bits, representing 32 9-bit registers (actually implemented as an array of 9 32-bit words)


Ken Smith

See also

Engines: HepRandomEngine, DRand48Engine , DualRand, HepJamesRandom, Hurd160Engine, MTwistEngine, RandEngine, RanecuEngine, 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/Hurd288Engine.h"

class Hurd288Engine: public HepRandomEngine

Public Member Functions

Hurd288Engine(long seed)
Hurd288Engine(HepInt rowIndex, HepInt colIndex)
Hurd288Engine(HepStd::istream& is)
Copy constructor
Hurd288Engine(const Hurd288Engine & p)
virtual ~Hurd288Engine()
Conversion operators
operator HepFloat()
Flat value, without worrying about filling bits

operator unsigned int()
32-bit flat value, quickest of all
Hurd288Engine & operator=(const Hurd288Engine & p)
HepDouble flat()
Returns a pseudo random number between 0 and 1
void flatArray(const HepInt size, HepDouble* vect)
Fills an array vect of specified size with flat random values.
void restoreStatus(const char filename[] = "Hurd288Engine.conf")
Reads from named file the last saved engine status and restores it.
void saveStatus(const char filename[] = "Hurd288Engine.conf") const
Saves on named file the current engine status.
void setSeed(long seed, HepInt)
Sets the state of the algorithm according to seed.
void setSeeds(const long * seeds, HepInt)
Sets the state of the algorithm according to the zero-terminated array of seeds.
void showStatus() const
Dumps the current engine status on the screen.

Non-Member Functions

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



15 May 2000