Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Static Protected Member Functions | Protected Attributes
CLHEP::HepRandomEngine Class Referenceabstract

#include <RandomEngine.h>

Inheritance diagram for CLHEP::HepRandomEngine:
CLHEP::DualRand CLHEP::HepJamesRandom CLHEP::MTwistEngine CLHEP::NonRandomEngine CLHEP::RanecuEngine CLHEP::Ranlux64Engine CLHEP::RanluxEngine CLHEP::RanshiEngine

Public Member Functions

 HepRandomEngine ()
 
virtual ~HepRandomEngine ()
 
bool operator== (const HepRandomEngine &engine)
 
bool operator!= (const HepRandomEngine &engine)
 
virtual double flat ()=0
 
virtual void flatArray (const int size, double *vect)=0
 
virtual void setSeed (long seed, int)=0
 
virtual void setSeeds (const long *seeds, int)=0
 
virtual void saveStatus (const char filename[]="Config.conf") const =0
 
virtual void restoreStatus (const char filename[]="Config.conf")=0
 
virtual void showStatus () const =0
 
virtual std::string name () const =0
 
virtual std::ostream & put (std::ostream &os) const
 
virtual std::istream & get (std::istream &is)
 
virtual std::istream & getState (std::istream &is)
 
virtual std::vector< unsigned
long > 
put () const
 
virtual bool get (const std::vector< unsigned long > &v)
 
virtual bool getState (const std::vector< unsigned long > &v)
 
long getSeed () const
 
const long * getSeeds () const
 
virtual operator double ()
 
virtual operator float ()
 
virtual operator unsigned int ()
 

Static Public Member Functions

static std::string beginTag ()
 
static HepRandomEnginenewEngine (std::istream &is)
 
static HepRandomEnginenewEngine (const std::vector< unsigned long > &v)
 

Static Protected Member Functions

static double exponent_bit_32 ()
 
static double mantissa_bit_12 ()
 
static double mantissa_bit_24 ()
 
static double mantissa_bit_32 ()
 
static double twoToMinus_32 ()
 
static double twoToMinus_48 ()
 
static double twoToMinus_49 ()
 
static double twoToMinus_53 ()
 
static double nearlyTwoToMinus_54 ()
 
static bool checkFile (std::istream &file, const std::string &filename, const std::string &classname, const std::string &methodname)
 

Protected Attributes

long theSeed
 
const long * theSeeds
 

Detailed Description

Author
Gabri.nosp@m.ele..nosp@m.Cosmo.nosp@m.@cer.nosp@m.n.ch

Definition at line 54 of file RandomEngine.h.

Constructor & Destructor Documentation

CLHEP::HepRandomEngine::HepRandomEngine ( )

Definition at line 25 of file RandomEngine.cc.

26 : theSeed (19780503L)
27 , theSeeds(&theSeed)
28 { }
CLHEP::HepRandomEngine::~HepRandomEngine ( )
virtual

Definition at line 30 of file RandomEngine.cc.

30 {}

Member Function Documentation

std::string CLHEP::HepRandomEngine::beginTag ( )
static

Definition at line 66 of file RandomEngine.cc.

66  {
67  return "HepRandomEngine-begin";
68 }
bool CLHEP::HepRandomEngine::checkFile ( std::istream &  file,
const std::string &  filename,
const std::string &  classname,
const std::string &  methodname 
)
staticprotected

Definition at line 45 of file RandomEngine.cc.

Referenced by CLHEP::MTwistEngine::restoreStatus(), CLHEP::HepJamesRandom::restoreStatus(), CLHEP::Ranlux64Engine::restoreStatus(), CLHEP::RanshiEngine::restoreStatus(), CLHEP::RanecuEngine::restoreStatus(), CLHEP::DualRand::restoreStatus(), and CLHEP::RanluxEngine::restoreStatus().

48  {
49  if (!file) {
50  std::cerr << "Failure to find or open file " << filename <<
51  " in " << classname << "::" << methodname << "()\n";
52  return false;
53  }
54  return true;
55 }
static double CLHEP::HepRandomEngine::exponent_bit_32 ( )
inlinestaticprotected
virtual double CLHEP::HepRandomEngine::flat ( )
pure virtual
virtual void CLHEP::HepRandomEngine::flatArray ( const int  size,
double *  vect 
)
pure virtual
std::istream & CLHEP::HepRandomEngine::get ( std::istream &  is)
virtual

Reimplemented in CLHEP::RanluxEngine, CLHEP::DualRand, CLHEP::RanecuEngine, CLHEP::RanshiEngine, CLHEP::Ranlux64Engine, CLHEP::HepJamesRandom, CLHEP::MTwistEngine, and CLHEP::NonRandomEngine.

Definition at line 61 of file RandomEngine.cc.

Referenced by CLHEP::HepRandom::engine(), CLHEP::HepRandom::getTheEngine(), and CLHEP::operator>>().

61  {
62  std::cerr << "HepRandomEngine::get called -- no effect!\n";
63  return is;
64 }
bool CLHEP::HepRandomEngine::get ( const std::vector< unsigned long > &  v)
virtual

Reimplemented in CLHEP::RanluxEngine, CLHEP::DualRand, CLHEP::RanecuEngine, CLHEP::RanshiEngine, CLHEP::Ranlux64Engine, CLHEP::HepJamesRandom, CLHEP::MTwistEngine, and CLHEP::NonRandomEngine.

Definition at line 80 of file RandomEngine.cc.

80  {
81  std::cerr << "HepRandomEngine::get(v) called -- no effect!\n";
82  return false;
83 }
long CLHEP::HepRandomEngine::getSeed ( ) const
inline

Definition at line 113 of file RandomEngine.h.

References theSeed.

113 { return theSeed; }
const long* CLHEP::HepRandomEngine::getSeeds ( ) const
inline

Definition at line 116 of file RandomEngine.h.

References theSeeds.

116 { return theSeeds; }
std::istream & CLHEP::HepRandomEngine::getState ( std::istream &  is)
virtual

Reimplemented in CLHEP::RanluxEngine, CLHEP::DualRand, CLHEP::RanecuEngine, CLHEP::RanshiEngine, CLHEP::Ranlux64Engine, CLHEP::HepJamesRandom, CLHEP::MTwistEngine, and CLHEP::NonRandomEngine.

Definition at line 70 of file RandomEngine.cc.

70  {
71  std::cerr << "HepRandomEngine::getState called -- no effect!\n";
72  return is;
73 }
bool CLHEP::HepRandomEngine::getState ( const std::vector< unsigned long > &  v)
virtual

Reimplemented in CLHEP::RanluxEngine, CLHEP::DualRand, CLHEP::RanecuEngine, CLHEP::RanshiEngine, CLHEP::Ranlux64Engine, CLHEP::HepJamesRandom, CLHEP::MTwistEngine, and CLHEP::NonRandomEngine.

Definition at line 84 of file RandomEngine.cc.

84  {
85  std::cerr << "HepRandomEngine::getState(v) called -- no effect!\n";
86  return false;
87 }
static double CLHEP::HepRandomEngine::mantissa_bit_12 ( )
inlinestaticprotected
static double CLHEP::HepRandomEngine::mantissa_bit_24 ( )
inlinestaticprotected
static double CLHEP::HepRandomEngine::mantissa_bit_32 ( )
inlinestaticprotected
virtual std::string CLHEP::HepRandomEngine::name ( ) const
pure virtual
static double CLHEP::HepRandomEngine::nearlyTwoToMinus_54 ( )
inlinestaticprotected
HepRandomEngine * CLHEP::HepRandomEngine::newEngine ( std::istream &  is)
static

Definition at line 89 of file RandomEngine.cc.

References CLHEP::EngineFactory::newEngine().

Referenced by CLHEP::StaticRandomStates::restore().

89  {
90  return EngineFactory::newEngine(is);
91 }
static HepRandomEngine * newEngine(std::istream &is)
HepRandomEngine * CLHEP::HepRandomEngine::newEngine ( const std::vector< unsigned long > &  v)
static

Definition at line 94 of file RandomEngine.cc.

References CLHEP::EngineFactory::newEngine().

94  {
96 }
static HepRandomEngine * newEngine(std::istream &is)
CLHEP::HepRandomEngine::operator double ( )
virtual

Definition at line 32 of file RandomEngine.cc.

References G4AblaRandom::flat().

32  {
33  return flat();
34 }
virtual double flat()=0
CLHEP::HepRandomEngine::operator float ( )
virtual

Reimplemented in CLHEP::DualRand, CLHEP::RanshiEngine, and CLHEP::MTwistEngine.

Definition at line 36 of file RandomEngine.cc.

References G4AblaRandom::flat().

36  {
37  return float( flat() );
38 }
virtual double flat()=0
CLHEP::HepRandomEngine::operator unsigned int ( )
virtual

Reimplemented in CLHEP::RanluxEngine, CLHEP::DualRand, CLHEP::RanecuEngine, CLHEP::RanshiEngine, CLHEP::HepJamesRandom, and CLHEP::MTwistEngine.

Definition at line 40 of file RandomEngine.cc.

References G4AblaRandom::flat().

40  {
41  return (unsigned int)( flat() * exponent_bit_32() );
42 }
virtual double flat()=0
static double exponent_bit_32()
bool CLHEP::HepRandomEngine::operator!= ( const HepRandomEngine engine)
inline
bool CLHEP::HepRandomEngine::operator== ( const HepRandomEngine engine)
inline
std::ostream & CLHEP::HepRandomEngine::put ( std::ostream &  os) const
virtual

Reimplemented in CLHEP::RanluxEngine, CLHEP::DualRand, CLHEP::RanecuEngine, CLHEP::RanshiEngine, CLHEP::Ranlux64Engine, CLHEP::HepJamesRandom, CLHEP::MTwistEngine, and CLHEP::NonRandomEngine.

Definition at line 57 of file RandomEngine.cc.

Referenced by CLHEP::operator<<().

57  {
58  std::cerr << "HepRandomEngine::put called -- no effect!\n";
59  return os;
60 }
std::vector< unsigned long > CLHEP::HepRandomEngine::put ( ) const
virtual

Reimplemented in CLHEP::RanluxEngine, CLHEP::DualRand, CLHEP::RanecuEngine, CLHEP::RanshiEngine, CLHEP::Ranlux64Engine, CLHEP::HepJamesRandom, CLHEP::MTwistEngine, and CLHEP::NonRandomEngine.

Definition at line 75 of file RandomEngine.cc.

References test::v.

75  {
76  std::cerr << "v=HepRandomEngine::put() called -- no data!\n";
77  std::vector<unsigned long> v;
78  return v;
79 }
virtual void CLHEP::HepRandomEngine::restoreStatus ( const char  filename[] = "Config.conf")
pure virtual
virtual void CLHEP::HepRandomEngine::saveStatus ( const char  filename[] = "Config.conf") const
pure virtual
virtual void CLHEP::HepRandomEngine::setSeed ( long  seed,
int   
)
pure virtual
virtual void CLHEP::HepRandomEngine::setSeeds ( const long *  seeds,
int   
)
pure virtual
virtual void CLHEP::HepRandomEngine::showStatus ( ) const
pure virtual
static double CLHEP::HepRandomEngine::twoToMinus_32 ( )
inlinestaticprotected
static double CLHEP::HepRandomEngine::twoToMinus_48 ( )
inlinestaticprotected
static double CLHEP::HepRandomEngine::twoToMinus_49 ( )
inlinestaticprotected
static double CLHEP::HepRandomEngine::twoToMinus_53 ( )
inlinestaticprotected

Field Documentation

long CLHEP::HepRandomEngine::theSeed
protected
const long* CLHEP::HepRandomEngine::theSeeds
protected

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