Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CLHEP
CLHEP
Commits
720b59ec
Commit
720b59ec
authored
Mar 09, 2005
by
Lynn Garren
Browse files
*** empty log message ***
parent
ca8b580e
Changes
3
Hide whitespace changes
Inline
Side-by-side
StdHep/StdHep/StdRandom.hh
View file @
720b59ec
...
...
@@ -38,8 +38,8 @@ public:
// --- mutators:
//
void
putState
(
std
::
istream
&
);
void
putState
(
std
::
string
&
);
void
putState
(
std
::
vector
<
unsigned
long
>
);
void
putState
(
std
::
string
const
&
);
void
putState
(
std
::
vector
<
unsigned
long
>
const
&
);
void
appendSeed
(
unsigned
long
sd
);
void
appendSeed
(
double
sd
);
void
clear
(
);
...
...
StdHep/src/StdRandom.cc
View file @
720b59ec
...
...
@@ -71,12 +71,12 @@ void StdRandom::putState( std::istream& ist )
myRandomState
=
st
.
str
();
}
void
StdRandom
::
putState
(
std
::
string
&
st
)
void
StdRandom
::
putState
(
std
::
string
const
&
st
)
{
myRandomState
=
st
;
}
void
StdRandom
::
putState
(
std
::
vector
<
unsigned
long
>
rs
)
void
StdRandom
::
putState
(
std
::
vector
<
unsigned
long
>
const
&
rs
)
{
std
::
ostringstream
st
;
for
(
unsigned
int
i
=
0
;
i
<
rs
.
size
();
++
i
)
{
...
...
StdHep/test/testStdRandom.cc
View file @
720b59ec
...
...
@@ -19,7 +19,6 @@ int main() {
int
status
=
0
;
double
d
,
saved
;
StdHep
::
StdRandom
rstate
;
std
::
string
state
;
// fill and save an arbitrary vector just for grins
std
::
vector
<
unsigned
long
>
rs
;
...
...
@@ -35,8 +34,7 @@ int main() {
// get and then save the state
std
::
ostringstream
ostr
;
simp
->
put
(
ostr
);
state
=
ostr
.
str
();
rstate
.
putState
(
state
);
rstate
.
putState
(
ostr
.
str
()
);
}
// this double is generated by the last saved state
d
=
simp
->
flat
();
...
...
@@ -51,7 +49,7 @@ int main() {
status
=
1
;
}
// restore the saved state
state
=
rstate
.
getStateAsString
();
std
::
string
state
=
rstate
.
getStateAsString
();
std
::
istringstream
ist
(
state
);
simp
->
get
(
ist
);
d
=
simp
->
flat
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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