38 defaults( HepRandom & g, HepJamesRandom & e )
43 void resetEngine( HepRandomEngine * newEngine ) {
47 void resetEngine( HepRandomEngine & newEngine ) {
48 theEngine.reset( &newEngine, do_nothing_deleter() );
51 bool ensureInitialized() {
64 defaults & theDefaults() {
65 static HepRandom theDefaultGenerator;
66 static HepJamesRandom theDefaultEngine;
67 static defaults theDefaults(theDefaultGenerator, theDefaultEngine);
85 theDefaults().resetEngine( algorithm );
90 theDefaults().resetEngine( algorithm );
98 return theDefaults().theEngine->flat();
103 theDefaults().theEngine->flatArray(size,vect);
112 std::cerr <<
"HepRandom::engine() called -- there is no assigned engine!\n";
113 return *theDefaults().theEngine.
get();
133 theDefaults().theEngine->setSeed(seed,lux);
138 return theDefaults().theEngine->getSeed();
143 theDefaults().theEngine->setSeeds(seeds,aux);
148 return theDefaults().theEngine->getSeeds();
153 if ((index >= 0) && (index < 215)) {
162 return theDefaults().theGenerator.
get();
167 return theDefaults().theEngine.
get();
177 theDefaults().theEngine->saveStatus( filename );
182 theDefaults().theEngine->restoreStatus( filename );
205 theDefaults().theEngine->showStatus();
210 return static_cast<int>( theDefaults().ensureInitialized() );
static const long * getTheSeeds()
static HepRandom * getTheGenerator()
shared_ptr< HepRandom > theGenerator
static void restoreEngineStatus(const char filename[]="Config.conf")
shared_ptr< HepRandomEngine > theEngine
static void setTheSeeds(const long *seeds, int aux=-1)
virtual std::istream & get(std::istream &is)
static const long seedTable[215][2]
void flatArray(const int size, double *vect)
static void setTheSeed(long seed, int lux=3)
static HepRandomEngine * getTheEngine()
virtual std::ostream & put(std::ostream &os) const
std::ostream & operator<<(std::ostream &os, const HepRandom &dist)
virtual HepRandomEngine & engine()
static void showEngineStatus()
static std::istream & restore(std::istream &is)
static int createInstance()
static std::ostream & save(std::ostream &os)
static void saveEngineStatus(const char filename[]="Config.conf")
static std::ostream & saveStaticRandomStates(std::ostream &os)
static void setTheEngine(HepRandomEngine *theNewEngine)
static std::ostream & saveFullState(std::ostream &os)
std::istream & operator>>(std::istream &is, HepRandom &dist)
virtual double operator()()
virtual std::string name() const
virtual std::istream & get(std::istream &is)
static std::istream & restoreFullState(std::istream &is)
static void getTheTableSeeds(long *seeds, int index)
static std::istream & restoreStaticRandomStates(std::istream &is)