Commit acedc700 authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

graph_blockmodel.hh: Return const references in egroup sampling

parent 8d806b4e
......@@ -2010,15 +2010,15 @@ struct egroups_manage
}
template <class Edge, class RNG>
static typename std::tuple_element<0, Edge>::type
sample_edge(DynamicSampler<Edge>& elist, RNG& rng)
static const typename std::tuple_element<0, Edge>::type&
sample_edge(const DynamicSampler<Edge>& elist, RNG& rng)
{
return get<0>(elist.sample(rng));
}
template <class Edge, class RNG>
static typename std::tuple_element<0, Edge>::type
sample_edge(vector<Edge>& elist, RNG& rng)
static const typename std::tuple_element<0, Edge>::type&
sample_edge(const vector<Edge>& elist, RNG& rng)
{
std::uniform_int_distribution<size_t> urand(0, elist.size() - 1);
size_t ur = urand(rng);
......
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