Commit 93dbb6c2 authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

blockmodel: Fix issue with sampling neighbours for degree-zero nodes

parent d510368f
......@@ -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
......
......@@ -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);
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment