28 #include "JamesRandom.h"
37 HepRandom* HepRandom::theGenerator = &aGenerator;
41 HepRandom::HepRandom()
43 set(false), oldm(-1.0), nextGauss(0.0), meanMax(2.0E9) {
44 for (HepInt i=0; i<3; ++i)
48 HepRandom::HepRandom(
long seed)
50 set(false), oldm(-1.0), nextGauss(0.0), meanMax(2.0E9) {
51 for (HepInt i=0; i<3; ++i)
56 : theEngine(&algorithm), deleteEngine(false),
57 set(false), oldm(-1.0), nextGauss(0.0), meanMax(2.0E9) {
59 for (HepInt i=0; i<3; ++i)
64 : theEngine(algorithm), deleteEngine(true),
65 set(false), oldm(-1.0), nextGauss(0.0), meanMax(2.0E9) {
66 for (HepInt i=0; i<3; ++i)
70 HepRandom::~HepRandom() {
71 if ( deleteEngine )
delete theEngine;
74 HepDouble HepRandom::operator()() {
82 void HepRandom::setTheSeed(
long seed, HepInt lux)
84 theGenerator->setSeed(seed,lux);
87 long HepRandom::getTheSeed()
89 return theGenerator->getSeed();
92 void HepRandom::setTheSeeds(
const long* seeds, HepInt aux)
94 theGenerator->setSeeds(seeds,aux);
97 const long* HepRandom::getTheSeeds ()
99 return theGenerator->getSeeds();
102 void HepRandom::getTheTableSeeds (
long* seeds, HepInt index)
104 theGenerator->getTableSeeds(seeds, index);
109 theGenerator->setEngine(theNewEngine);
114 return theGenerator->getEngine();
117 void HepRandom::saveEngineStatus()
119 theGenerator->saveStatus();
122 void HepRandom::restoreEngineStatus()
124 theGenerator->restoreStatus();
127 void HepRandom::showEngineStatus()
129 theGenerator->showStatus();