14#include "CLHEP/Random/defs.h"
15#include "CLHEP/Random/EngineFactory.h"
16#include "CLHEP/Random/DRand48Engine.h"
17#include "CLHEP/Random/DualRand.h"
18#include "CLHEP/Random/Hurd160Engine.h"
19#include "CLHEP/Random/Hurd288Engine.h"
20#include "CLHEP/Random/JamesRandom.h"
21#include "CLHEP/Random/JamesRandom.h"
22#include "CLHEP/Random/MixMaxRng.h"
23#include "CLHEP/Random/MTwistEngine.h"
24#include "CLHEP/Random/RandEngine.h"
25#include "CLHEP/Random/RanecuEngine.h"
26#include "CLHEP/Random/Ranlux64Engine.h"
27#include "CLHEP/Random/RanluxppEngine.h"
28#include "CLHEP/Random/RanluxEngine.h"
29#include "CLHEP/Random/RanshiEngine.h"
30#include "CLHEP/Random/TripleRand.h"
31#include "CLHEP/Random/NonRandomEngine.h"
32#include "CLHEP/Random/engineIDulong.h"
40static HepRandomEngine*
41makeAnEngine (
const std::string & tag,
43 if ( tag != E::beginTag() )
return 0;
44 HepRandomEngine* eptr =
new E;
51static HepRandomEngine*
52makeAnEngine (
const std::vector<unsigned long> & v) {
53 if ( (v[0] & 0xffffffffUL) != engineIDulong<E>() )
return 0;
54 HepRandomEngine* eptr =
new E;
56 if (!success)
return 0;
65 eptr = makeAnEngine <HepJamesRandom> (tag, is);
if (eptr)
return eptr;
66 eptr = makeAnEngine <RanecuEngine> (tag, is);
if (eptr)
return eptr;
67 eptr = makeAnEngine <Ranlux64Engine> (tag, is);
if (eptr)
return eptr;
68 eptr = makeAnEngine <RanluxppEngine> (tag, is);
if (eptr)
return eptr;
69 eptr = makeAnEngine <MixMaxRng> (tag, is);
if (eptr)
return eptr;
70 eptr = makeAnEngine <MTwistEngine> (tag, is);
if (eptr)
return eptr;
71 eptr = makeAnEngine <DRand48Engine> (tag, is);
if (eptr)
return eptr;
72 eptr = makeAnEngine <TripleRand> (tag, is);
if (eptr)
return eptr;
73 eptr = makeAnEngine <DualRand> (tag, is);
if (eptr)
return eptr;
74 eptr = makeAnEngine <Hurd160Engine> (tag, is);
if (eptr)
return eptr;
75 eptr = makeAnEngine <Hurd288Engine> (tag, is);
if (eptr)
return eptr;
76 eptr = makeAnEngine <RandEngine> (tag, is);
if (eptr)
return eptr;
77 eptr = makeAnEngine <RanluxEngine> (tag, is);
if (eptr)
return eptr;
78 eptr = makeAnEngine <RanshiEngine> (tag, is);
if (eptr)
return eptr;
79 eptr = makeAnEngine <NonRandomEngine> (tag, is);
if (eptr)
return eptr;
80 is.clear(std::ios::badbit | is.rdstate());
82 "Input mispositioned or bad in reading anonymous engine\n"
83 <<
"\nBegin-tag read was: " << tag
84 <<
"\nInput stream is probably fouled up\n";
91 eptr = makeAnEngine <HepJamesRandom> (v);
if (eptr)
return eptr;
92 eptr = makeAnEngine <RanecuEngine> (v);
if (eptr)
return eptr;
93 eptr = makeAnEngine <Ranlux64Engine> (v);
if (eptr)
return eptr;
94 eptr = makeAnEngine <RanluxppEngine> (v);
if (eptr)
return eptr;
95 eptr = makeAnEngine <MixMaxRng> (v);
if (eptr)
return eptr;
96 eptr = makeAnEngine <MTwistEngine> (v);
if (eptr)
return eptr;
97 eptr = makeAnEngine <DRand48Engine> (v);
if (eptr)
return eptr;
98 eptr = makeAnEngine <TripleRand> (v);
if (eptr)
return eptr;
99 eptr = makeAnEngine <DualRand> (v);
if (eptr)
return eptr;
100 eptr = makeAnEngine <Hurd160Engine> (v);
if (eptr)
return eptr;
101 eptr = makeAnEngine <Hurd288Engine> (v);
if (eptr)
return eptr;
102 eptr = makeAnEngine <RandEngine> (v);
if (eptr)
return eptr;
103 eptr = makeAnEngine <RanluxEngine> (v);
if (eptr)
return eptr;
104 eptr = makeAnEngine <RanshiEngine> (v);
if (eptr)
return eptr;
105 eptr = makeAnEngine <NonRandomEngine> (v);
if (eptr)
return eptr;
107 "Cannot correctly get anonymous engine from vector\n"
108 <<
"First unsigned long was: " << v[0]
109 <<
" Vector size was: " << v.size() <<
"\n";
static HepRandomEngine * newEngine(std::istream &is)
virtual std::istream & getState(std::istream &is)