Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Lukas Weber
load_leveller
Commits
8e58d325
Commit
8e58d325
authored
Dec 05, 2017
by
Lukas Weber
Browse files
make sweeps accessible by mc
parent
989ac7b1
Changes
2
Hide whitespace changes
Inline
Side-by-side
mc.cpp
View file @
8e58d325
...
...
@@ -43,6 +43,10 @@ void abstract_mc::random_clear() {
double
abstract_mc
::
random01
()
{
return
rng
->
d
();
}
int
abstract_mc
::
sweep
()
const
{
return
_sweep
;
}
void
abstract_mc
::
_init
()
{
random_init
();
...
...
@@ -50,20 +54,20 @@ void abstract_mc::_init() {
}
void
abstract_mc
::
_do_update
()
{
sweep
++
;
_
sweep
++
;
do_update
();
}
void
abstract_mc
::
_write
(
std
::
string
dir
)
{
odump
d
(
dir
+
"dump"
);
random_write
(
d
);
d
.
write
(
sweep
);
d
.
write
(
_
sweep
);
write
(
d
);
d
.
close
();
seed_write
(
dir
+
"seed"
);
dir
+=
"sweeps"
;
ofstream
f
;
f
.
open
(
dir
.
c_str
());
f
<<
(
(
is_thermalized
())
?
sweep
-
therm
:
0
)
<<
" "
<<
sweep
<<
endl
;
f
<<
(
(
is_thermalized
())
?
_
sweep
-
therm
:
0
)
<<
" "
<<
_
sweep
<<
endl
;
f
.
close
();
}
...
...
@@ -72,7 +76,7 @@ bool abstract_mc::_read(std::string dir) {
if
(
!
d
)
return
false
;
random_read
(
d
);
d
.
read
(
sweep
);
d
.
read
(
_
sweep
);
if
(
!
read
(
d
))
return
false
;
...
...
@@ -90,6 +94,6 @@ void abstract_mc::_write_output(std::string filename) {
}
bool
abstract_mc
::
is_thermalized
()
{
return
sweep
>
therm
;
return
_
sweep
>
therm
;
}
mc.h
View file @
8e58d325
...
...
@@ -22,7 +22,7 @@ class abstract_mc
void
random_read
(
idump
&
d
);
void
random_init
();
int
sweep
=
0
;
int
_
sweep
=
0
;
int
therm
=
0
;
protected:
parser
param
;
...
...
@@ -34,6 +34,7 @@ class abstract_mc
virtual
void
do_update
()
=
0
;
public:
double
random01
();
int
sweep
()
const
;
virtual
void
do_measurement
()
=
0
;
...
...
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