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
Tiago Peixoto
graph-tool
Commits
93dbb6c2
Commit
93dbb6c2
authored
Jul 18, 2016
by
Tiago Peixoto
Browse files
blockmodel: Fix issue with sampling neighbours for degree-zero nodes
parent
d510368f
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/graph/inference/graph_blockmodel.hh
View file @
93dbb6c2
...
...
@@ -1298,9 +1298,10 @@ public:
size_t
random_neighbour
(
size_t
v
,
rng_t
&
rng
)
{
if
(
_neighbour_sampler
[
v
].
size
()
==
0
)
auto
&
sampler
=
_neighbour_sampler
[
v
];
if
(
sampler
.
empty
())
return
v
;
return
sample_neighbour
(
_neighbour_
sampler
[
v
]
,
rng
);
return
sample_neighbour
(
sampler
,
rng
);
}
// Computes the move proposal probability
...
...
src/graph/inference/graph_blockmodel_util.hh
View file @
93dbb6c2
...
...
@@ -1528,12 +1528,6 @@ void build_neighbour_sampler(Vertex v, SMap& sampler, Eprop& eweight, Graph& g,
// 2 * eweight[e]
}
if
(
probs
.
empty
())
{
neighbours
.
push_back
(
v
);
probs
.
push_back
(
1.
);
}
sampler
=
Sampler
<
Vertex
,
mpl
::
false_
>
(
neighbours
,
probs
);
};
...
...
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