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
3de2946d
Commit
3de2946d
authored
Jan 25, 2016
by
Tiago Peixoto
Browse files
Fix bug in sampled distance histogram
parent
d7f9030b
Pipeline
#103
failed with stage
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/graph/stats/graph_distance_sampled.hh
View file @
3de2946d
...
...
@@ -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
)
...
...
src/graph_tool/stats/__init__.py
View file @
3de2946d
...
...
@@ -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
),
...
...
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