Commit 3de2946d authored by Tiago Peixoto's avatar Tiago Peixoto

Fix bug in sampled distance histogram

parent d7f9030b
Pipeline #103 failed with stage
......@@ -80,14 +80,13 @@ struct get_sampled_distance_histogram
vector<vertex_t> sources;
sources.reserve(num_vertices(g));
int i;
for (i = 0; i < int(num_vertices(g)); ++i)
if (!is_valid_vertex(vertex(i, g), g))
sources.push_back(vertex(i, g));
for (auto v : vertices_range(g))
sources.push_back(v);
n_samples = min(n_samples, sources.size());
typename hist_t::point_t point;
get_vertex_dists_t get_vertex_dists;
int i;
#pragma omp parallel for default(shared) private(i,point) \
firstprivate(s_hist) schedule(runtime) if (num_vertices(g) * n_samples > 100)
for (i = 0; i < int(n_samples); ++i)
......
......@@ -432,7 +432,7 @@ def distance_histogram(g, weight=None, bins=[0, 1], samples=None,
[array([ 0., 30., 88., 226., 391., 240., 15.]), array([0, 1, 2, 3, 4, 5, 6, 7], dtype=uint...)]
"""
if samples != None:
if samples is not None:
ret = libgraph_tool_stats.\
sampled_distance_histogram(g._Graph__graph,
_prop("e", g, weight),
......
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