Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CLHEP
CLHEP
Commits
3f792cca
Commit
3f792cca
authored
Jun 11, 2018
by
Lynn Garren
Browse files
adding operator double()
parent
c6111eb4
Changes
23
Hide whitespace changes
Inline
Side-by-side
Random/Random/DualRand.h
View file @
3f792cca
...
...
@@ -85,7 +85,8 @@ public:
void
showStatus
()
const
;
// Dumps the current engine status on the screen.
operator
float
();
// flat value, without worrying about filling bits
operator
double
();
// Returns same as flat()
operator
float
();
// flat value, without worrying about filling bits
operator
unsigned
int
();
// 32-bit flat value, quickest of all
virtual
std
::
ostream
&
put
(
std
::
ostream
&
os
)
const
;
...
...
Random/Random/Hurd160Engine.h
View file @
3f792cca
...
...
@@ -72,8 +72,9 @@ public:
void
showStatus
()
const
;
// Dumps the engine status on the screen
operator
float
();
// flat value, without worrying about filling bits
operator
unsigned
int
();
// 32-bit flat value, quickest of all
operator
double
();
// Returns same as flat()
operator
float
();
// flat value, without worrying about filling bits
operator
unsigned
int
();
// 32-bit flat value, quickest of all
virtual
std
::
ostream
&
put
(
std
::
ostream
&
os
)
const
;
virtual
std
::
istream
&
get
(
std
::
istream
&
is
);
...
...
Random/Random/Hurd288Engine.h
View file @
3f792cca
...
...
@@ -71,8 +71,9 @@ public:
void
showStatus
()
const
;
// Dumps the engine status on the screen
operator
float
();
// flat value, without worrying about filling bits
operator
unsigned
int
();
// 32-bit flat value, quickest of all
operator
double
();
// Returns same as flat()
operator
float
();
// flat value, without worrying about filling bits
operator
unsigned
int
();
// 32-bit flat value, quickest of all
virtual
std
::
ostream
&
put
(
std
::
ostream
&
os
)
const
;
virtual
std
::
istream
&
get
(
std
::
istream
&
is
);
...
...
Random/Random/JamesRandom.h
View file @
3f792cca
...
...
@@ -77,6 +77,10 @@ public:
void
showStatus
()
const
;
// Dumps the engine status on the screen.
operator
double
();
// Returns same as flat()
operator
float
();
// less precise flat, faster if possible
operator
unsigned
int
();
// 32-bit flat, but slower than double or float.
...
...
Random/Random/MTwistEngine.h
View file @
3f792cca
...
...
@@ -66,7 +66,8 @@ public:
void
showStatus
()
const
;
// Dumps the current engine status on the screen.
operator
float
();
// returns flat, without worrying about filling bits
operator
double
();
// Returns same as flat()
operator
float
();
// returns flat, without worrying about filling bits
operator
unsigned
int
();
// 32-bit flat, quickest of all
virtual
std
::
ostream
&
put
(
std
::
ostream
&
os
)
const
;
...
...
Random/Random/MixMaxRng.h
View file @
3f792cca
...
...
@@ -91,6 +91,10 @@ public:
void
showStatus
()
const
;
// Dumps the engine status on the screen.
operator
double
();
// Returns same as flat()
operator
float
();
// less precise flat, faster if possible
operator
unsigned
int
();
// 32-bit flat
...
...
@@ -179,7 +183,7 @@ private:
typedef
struct
rng_state_st
rng_state_t
;
// struct alias
rng_state_t
S
;
};
}
// namespace CLHEP
#endif
Random/Random/RandEngine.h
View file @
3f792cca
...
...
@@ -90,6 +90,8 @@ public:
void
showStatus
()
const
;
// Dumps the engine status on the screen.
operator
double
();
// Returns same as flat()
operator
float
();
// flat value, without worrying about filling bits
operator
unsigned
int
();
// 32-bit flat value, quickest of all.
virtual
std
::
ostream
&
put
(
std
::
ostream
&
os
)
const
;
...
...
Random/Random/RanecuEngine.h
View file @
3f792cca
...
...
@@ -85,6 +85,10 @@ public:
void
showStatus
()
const
;
// Dumps the engine status on the screen.
operator
double
();
// Returns same as flat()
operator
float
();
// less precise flat, faster if possible
operator
unsigned
int
();
// 32-bit int flat, faster in this case
...
...
Random/Random/RanluxEngine.h
View file @
3f792cca
...
...
@@ -92,6 +92,8 @@ public:
int
getLuxury
()
const
{
return
luxury
;
}
// Gets the luxury level.
operator
double
();
// Returns same as flat()
operator
float
();
// less precise flat, faster if possible
operator
unsigned
int
();
// 32-bit flat, but slower than double or float
virtual
std
::
ostream
&
put
(
std
::
ostream
&
os
)
const
;
...
...
Random/Random/RanshiEngine.h
View file @
3f792cca
...
...
@@ -84,20 +84,21 @@ public:
void
showStatus
()
const
;
// Dumps the engine status on the screen
operator
float
();
// flat value, without worrying about filling bits
operator
unsigned
int
();
// 32-bit flat value, quickest of all
operator
double
();
// Returns same as flat()
operator
float
();
// flat value, without worrying about filling bits
operator
unsigned
int
();
// 32-bit flat value, quickest of all
virtual
std
::
ostream
&
put
(
std
::
ostream
&
os
)
const
;
virtual
std
::
istream
&
get
(
std
::
istream
&
is
);
static
std
::
string
beginTag
(
);
virtual
std
::
istream
&
getState
(
std
::
istream
&
is
);
virtual
std
::
ostream
&
put
(
std
::
ostream
&
os
)
const
;
virtual
std
::
istream
&
get
(
std
::
istream
&
is
);
static
std
::
string
beginTag
(
);
virtual
std
::
istream
&
getState
(
std
::
istream
&
is
);
std
::
string
name
()
const
;
static
std
::
string
engineName
()
{
return
"RanshiEngine"
;}
std
::
string
name
()
const
;
static
std
::
string
engineName
()
{
return
"RanshiEngine"
;}
std
::
vector
<
unsigned
long
>
put
()
const
;
bool
get
(
const
std
::
vector
<
unsigned
long
>
&
v
);
bool
getState
(
const
std
::
vector
<
unsigned
long
>
&
v
);
std
::
vector
<
unsigned
long
>
put
()
const
;
bool
get
(
const
std
::
vector
<
unsigned
long
>
&
v
);
bool
getState
(
const
std
::
vector
<
unsigned
long
>
&
v
);
private:
enum
{
numBuff
=
512
};
...
...
Random/Random/TripleRand.h
View file @
3f792cca
...
...
@@ -83,8 +83,9 @@ public:
void
showStatus
()
const
;
// Dumps the current engine status on the screen.
operator
float
();
// flat value, without worrying about filling bits
operator
unsigned
int
();
// 32-bit flat value, quickest of all
operator
double
();
// Returns same as flat()
operator
float
();
// flat value, without worrying about filling bits
operator
unsigned
int
();
// 32-bit flat value, quickest of all
virtual
std
::
ostream
&
put
(
std
::
ostream
&
os
)
const
;
virtual
std
::
istream
&
get
(
std
::
istream
&
is
);
...
...
Random/src/DoubConv.cc
View file @
3f792cca
...
...
@@ -23,10 +23,6 @@ void DoubConv::fill_byte_order () {
z
*=
256
;
}
// x, in IEEE format, would now be 0x4330060504030201
union
DB8
{
unsigned
char
b
[
8
];
double
d
;
};
DB8
xb
;
xb
.
d
=
x
;
int
n
;
...
...
@@ -121,4 +117,4 @@ double DoubConv::longs2double (const std::vector<unsigned long> & v) {
return
db
.
d
;
}
}
// end namespace
HepMC
}
// end namespace
CLHEP
Random/src/DualRand.cc
View file @
3f792cca
...
...
@@ -216,6 +216,10 @@ void DualRand::showStatus() const {
std
::
cout
.
precision
(
pr
);
}
DualRand
::
operator
double
()
{
return
flat
();
}
DualRand
::
operator
float
()
{
return
(
float
)
(
(
integerCong
^
tausworthe
)
*
twoToMinus_32
()
+
nearlyTwoToMinus_54
()
);
...
...
Random/src/Hurd160Engine.cc
View file @
3f792cca
...
...
@@ -243,6 +243,10 @@ void Hurd160Engine::showStatus() const {
std
::
cout
.
precision
(
pr
);
}
Hurd160Engine
::
operator
double
()
{
return
flat
();
}
Hurd160Engine
::
operator
float
()
{
if
(
wordIndex
<=
1
)
{
// MF 9/15/98: skip word 0
advance
();
...
...
Random/src/Hurd288Engine.cc
View file @
3f792cca
...
...
@@ -263,6 +263,10 @@ void Hurd288Engine::showStatus() const {
std
::
cout
<<
"-------------------------------------------"
<<
std
::
endl
;
}
Hurd288Engine
::
operator
double
()
{
return
flat
();
}
Hurd288Engine
::
operator
float
()
{
if
(
wordIndex
<=
1
)
{
// MF 9/15/98: skip word 0
advance
();
...
...
Random/src/JamesRandom.cc
View file @
3f792cca
...
...
@@ -296,6 +296,14 @@ void HepJamesRandom::flatArray(const int size, double* vect)
}
}
HepJamesRandom
::
operator
double
()
{
return
flat
();
}
HepJamesRandom
::
operator
float
()
{
return
float
(
flat
()
);
}
HepJamesRandom
::
operator
unsigned
int
()
{
return
((
unsigned
int
)(
flat
()
*
exponent_bit_32
())
&
0xffffffff
)
|
(((
unsigned
int
)(
u
[
i97
]
*
exponent_bit_32
())
>>
16
)
&
0xff
);
...
...
Random/src/MTwistEngine.cc
View file @
3f792cca
...
...
@@ -231,6 +231,10 @@ void MTwistEngine::showStatus() const
std
::
cout
<<
"----------------------------------------"
<<
std
::
endl
;
}
MTwistEngine
::
operator
double
()
{
return
flat
();
}
MTwistEngine
::
operator
float
()
{
unsigned
int
y
;
...
...
Random/src/MixMaxRng.cc
View file @
3f792cca
...
...
@@ -339,6 +339,16 @@ void MixMaxRng::flatArray(const int size, double* vect )
for
(
int
i
=
0
;
i
<
size
;
++
i
)
{
vect
[
i
]
=
flat
();
}
}
MixMaxRng
::
operator
double
()
{
return
flat
();
}
MixMaxRng
::
operator
float
()
{
return
float
(
flat
()
);
}
MixMaxRng
::
operator
unsigned
int
()
{
return
static_cast
<
unsigned
int
>
(
get_next
());
...
...
@@ -706,7 +716,7 @@ myuint_t MixMaxRng::apply_bigskip( myuint_t* Vout, myuint_t* Vin, myID_t cluster
myuint_t
MixMaxRng
::
modadd
(
myuint_t
foo
,
myuint_t
bar
)
{
#if defined(__x86_64__) &&
defined(__GNUC__) && (!defined(__ICC))
#if defined(__x86_64__) && defined(__GNUC__) && (!defined(__ICC))
//#warning Using assembler routine in modadd
myuint_t
out
;
/* Assembler trick suggested by Andrzej Görlich */
...
...
Random/src/RandEngine.cc
View file @
3f792cca
...
...
@@ -365,6 +365,14 @@ void RandEngine::flatArray(const int size, double* vect)
vect
[
i
]
=
flat
();
}
RandEngine
::
operator
double
()
{
return
flat
();
}
RandEngine
::
operator
float
()
{
return
float
(
flat
()
);
}
RandEngine
::
operator
unsigned
int
()
{
return
RandEngineBuilder
<
RAND_MAX
>::
thirtyTwoRandomBits
(
seq
);
}
...
...
Random/src/RanecuEngine.cc
View file @
3f792cca
...
...
@@ -266,6 +266,14 @@ void RanecuEngine::flatArray(const int size, double* vect)
table
[
index
][
1
]
=
seed2
;
}
RanecuEngine
::
operator
double
()
{
return
flat
();
}
RanecuEngine
::
operator
float
()
{
return
float
(
flat
()
);
}
RanecuEngine
::
operator
unsigned
int
()
{
const
int
index
=
seq
;
long
seed1
=
table
[
index
][
0
];
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment