Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CLHEP::HepRandom Class Reference

#include <Random.h>

Inheritance diagram for CLHEP::HepRandom:

Public Member Functions

 HepRandom ()
 
 HepRandom (long seed)
 
 HepRandom (HepRandomEngine &algorithm)
 
 HepRandom (HepRandomEngine *algorithm)
 
virtual ~HepRandom ()
 
double flat ()
 
void flatArray (const int size, double *vect)
 
double flat (HepRandomEngine *theNewEngine)
 
void flatArray (HepRandomEngine *theNewEngine, const int size, double *vect)
 
virtual double operator() ()
 
virtual std::string name () const
 
virtual HepRandomEngineengine ()
 
virtual std::ostream & put (std::ostream &os) const
 
virtual std::istream & get (std::istream &is)
 

Static Public Member Functions

static void setTheSeed (long seed, int lux=3)
 
static long getTheSeed ()
 
static void setTheSeeds (const long *seeds, int aux=-1)
 
static const long * getTheSeeds ()
 
static void getTheTableSeeds (long *seeds, int index)
 
static HepRandomgetTheGenerator ()
 
static void setTheEngine (HepRandomEngine *theNewEngine)
 
static HepRandomEnginegetTheEngine ()
 
static void saveEngineStatus (const char filename[]="Config.conf")
 
static void restoreEngineStatus (const char filename[]="Config.conf")
 
static std::ostream & saveFullState (std::ostream &os)
 
static std::istream & restoreFullState (std::istream &is)
 
static std::ostream & saveDistState (std::ostream &os)
 
static std::istream & restoreDistState (std::istream &is)
 
static std::ostream & saveStaticRandomStates (std::ostream &os)
 
static std::istream & restoreStaticRandomStates (std::istream &is)
 
static void showEngineStatus ()
 
static int createInstance ()
 
static std::string distributionName ()
 

Static Protected Attributes

static const long seedTable [215][2]
 

Detailed Description

Constructor & Destructor Documentation

CLHEP::HepRandom::HepRandom ( )

Definition at line 175 of file Random.cc.

176 { }
CLHEP::HepRandom::HepRandom ( long  seed)

Definition at line 178 of file Random.cc.

179 {
180  setTheSeed(seed);
181 }
static void setTheSeed(long seed, int lux=3)
Definition: Random.cc:231
CLHEP::HepRandom::HepRandom ( HepRandomEngine algorithm)

Definition at line 183 of file Random.cc.

184 {
185  theDefaults().resetEngine( algorithm );
186 }
CLHEP::HepRandom::HepRandom ( HepRandomEngine algorithm)

Definition at line 188 of file Random.cc.

189 {
190  theDefaults().resetEngine( algorithm );
191 }
CLHEP::HepRandom::~HepRandom ( )
virtual

Definition at line 193 of file Random.cc.

194 { }

Member Function Documentation

int CLHEP::HepRandom::createInstance ( )
static

Definition at line 308 of file Random.cc.

309 {
310  return static_cast<int>( theDefaults().ensureInitialized() );
311 }
static std::string CLHEP::HepRandom::distributionName ( )
inlinestatic

Definition at line 152 of file Random.h.

152 {return "HepRandomEngine";}
HepRandomEngine & CLHEP::HepRandom::engine ( )
virtual

Reimplemented in CLHEP::RandFlat, CLHEP::RandBreitWigner, CLHEP::RandGeneral, CLHEP::RandExpZiggurat, CLHEP::RandGaussQ, CLHEP::RandPoissonQ, CLHEP::RandGauss, CLHEP::RandStudentT, CLHEP::RandBinomial, CLHEP::RandGamma, CLHEP::RandLandau, CLHEP::RandChiSquare, CLHEP::RandPoisson, CLHEP::RandExponential, and CLHEP::RandGaussZiggurat.

Definition at line 211 of file Random.cc.

211  {
212  std::cerr << "HepRandom::engine() called -- there is no assigned engine!\n";
213  return *theDefaults().theEngine.get();
214 }
double CLHEP::HepRandom::flat ( )

Definition at line 196 of file Random.cc.

197 {
198  return theDefaults().theEngine->flat();
199 }

Here is the caller graph for this function:

double CLHEP::HepRandom::flat ( HepRandomEngine theNewEngine)
inline
void CLHEP::HepRandom::flatArray ( const int  size,
double *  vect 
)

Definition at line 201 of file Random.cc.

202 {
203  theDefaults().theEngine->flatArray(size,vect);
204 }
void CLHEP::HepRandom::flatArray ( HepRandomEngine theNewEngine,
const int  size,
double *  vect 
)
inline
std::istream & CLHEP::HepRandom::get ( std::istream &  is)
virtual
HepRandomEngine * CLHEP::HepRandom::getTheEngine ( )
static

Definition at line 265 of file Random.cc.

266 {
267  return theDefaults().theEngine.get();
268 }

Here is the call graph for this function:

Here is the caller graph for this function:

HepRandom * CLHEP::HepRandom::getTheGenerator ( )
static

Definition at line 260 of file Random.cc.

261 {
262  return theDefaults().theGenerator.get();
263 }

Here is the call graph for this function:

long CLHEP::HepRandom::getTheSeed ( )
static

Definition at line 236 of file Random.cc.

237 {
238  return theDefaults().theEngine->getSeed();
239 }
const long * CLHEP::HepRandom::getTheSeeds ( )
static

Definition at line 246 of file Random.cc.

247 {
248  return theDefaults().theEngine->getSeeds();
249 }
void CLHEP::HepRandom::getTheTableSeeds ( long *  seeds,
int  index 
)
static

Definition at line 251 of file Random.cc.

252 {
253  if ((index >= 0) && (index < 215)) {
254  seeds[0] = seedTable[index][0];
255  seeds[1] = seedTable[index][1];
256  }
257  else seeds = NULL;
258 }
static const long seedTable[215][2]
Definition: Random.h:157

Here is the caller graph for this function:

double CLHEP::HepRandom::operator() ( )
virtual
std::ostream & CLHEP::HepRandom::put ( std::ostream &  os) const
virtual
static std::istream& CLHEP::HepRandom::restoreDistState ( std::istream &  is)
inlinestatic

Definition at line 137 of file Random.h.

137 {return is;}
void CLHEP::HepRandom::restoreEngineStatus ( const char  filename[] = "Config.conf")
static

Definition at line 280 of file Random.cc.

281 {
282  theDefaults().theEngine->restoreStatus( filename );
283 }
std::istream & CLHEP::HepRandom::restoreFullState ( std::istream &  is)
static

Definition at line 290 of file Random.cc.

290  {
291  is >> *getTheEngine();
292  return is;
293 }
static HepRandomEngine * getTheEngine()
Definition: Random.cc:265

Here is the caller graph for this function:

std::istream & CLHEP::HepRandom::restoreStaticRandomStates ( std::istream &  is)
static

Definition at line 299 of file Random.cc.

299  {
300  return StaticRandomStates::restore(is);
301 }
static std::istream & restore(std::istream &is)
static std::ostream& CLHEP::HepRandom::saveDistState ( std::ostream &  os)
inlinestatic

Definition at line 134 of file Random.h.

134 {return os;}
void CLHEP::HepRandom::saveEngineStatus ( const char  filename[] = "Config.conf")
static

Definition at line 275 of file Random.cc.

276 {
277  theDefaults().theEngine->saveStatus( filename );
278 }

Here is the caller graph for this function:

std::ostream & CLHEP::HepRandom::saveFullState ( std::ostream &  os)
static

Definition at line 285 of file Random.cc.

285  {
286  os << *getTheEngine();
287  return os;
288 }
static HepRandomEngine * getTheEngine()
Definition: Random.cc:265

Here is the caller graph for this function:

std::ostream & CLHEP::HepRandom::saveStaticRandomStates ( std::ostream &  os)
static

Definition at line 295 of file Random.cc.

295  {
296  return StaticRandomStates::save(os);
297 }
static std::ostream & save(std::ostream &os)
void CLHEP::HepRandom::setTheEngine ( HepRandomEngine theNewEngine)
static

Definition at line 270 of file Random.cc.

271 {
272  theDefaults().theEngine.reset( theNewEngine, do_nothing_deleter() );
273 }

Here is the caller graph for this function:

void CLHEP::HepRandom::setTheSeed ( long  seed,
int  lux = 3 
)
static

Definition at line 231 of file Random.cc.

232 {
233  theDefaults().theEngine->setSeed(seed,lux);
234 }
static constexpr double lux
void CLHEP::HepRandom::setTheSeeds ( const long *  seeds,
int  aux = -1 
)
static

Definition at line 241 of file Random.cc.

242 {
243  theDefaults().theEngine->setSeeds(seeds,aux);
244 }
void CLHEP::HepRandom::showEngineStatus ( )
static

Definition at line 303 of file Random.cc.

304 {
305  theDefaults().theEngine->showStatus();
306 }

Member Data Documentation

const long CLHEP::HepRandom::seedTable
staticprotected

Definition at line 157 of file Random.h.


The documentation for this class was generated from the following files: