Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Malte R
graph-tool
Commits
06035ce3
Commit
06035ce3
authored
Jan 23, 2017
by
Tiago Peixoto
Browse files
mcmc_loop.hh: Shuffle only if sweep is sequential
parent
b1430b32
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/graph/inference/mcmc_loop.hh
View file @
06035ce3
...
...
@@ -69,11 +69,15 @@ auto mcmc_sweep(MCMCState state, RNG& rng)
for
(
size_t
iter
=
0
;
iter
<
state
.
_niter
;
++
iter
)
{
std
::
shuffle
(
vlist
.
begin
(),
vlist
.
end
(),
rng
);
if
(
state
.
_sequential
)
std
::
shuffle
(
vlist
.
begin
(),
vlist
.
end
(),
rng
);
for
(
auto
v
:
vlist
)
for
(
size_t
vi
=
0
;
vi
<
vlist
.
size
();
++
vi
)
{
if
(
!
state
.
_sequential
)
size_t
v
;
if
(
state
.
_sequential
)
v
=
vlist
[
vi
];
else
v
=
uniform_sample
(
vlist
,
rng
);
if
(
state
.
node_weight
(
v
)
==
0
)
...
...
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