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
67eff378
Commit
67eff378
authored
Mar 20, 2013
by
Tiago Peixoto
Browse files
Fix initialization of distance values in shortest_distance()
parent
f90c6c2b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/graph/topology/graph_distance.cc
View file @
67eff378
...
...
@@ -109,6 +109,12 @@ struct do_bfs_search
dist_t
max_d
=
(
max_dist
>
0
)
?
max_dist
:
numeric_limits
<
dist_t
>::
max
();
int
i
,
N
=
num_vertices
(
g
);
#pragma omp parallel for default(shared) private(i)
for
(
i
=
0
;
i
<
N
;
++
i
)
dist_map
[
i
]
=
numeric_limits
<
dist_t
>::
max
();
dist_map
[
source
]
=
0
;
pred_map
[
vertex
(
source
,
g
)]
=
vertex
(
source
,
g
);
unchecked_vector_property_map
<
boost
::
default_color_type
,
VertexIndexMap
>
color_map
(
vertex_index
,
num_vertices
(
g
));
...
...
@@ -136,6 +142,12 @@ struct do_djk_search
dist_t
max_d
=
(
max_dist
>
0
)
?
max_dist
:
numeric_limits
<
dist_t
>::
max
();
int
i
,
N
=
num_vertices
(
g
);
#pragma omp parallel for default(shared) private(i)
for
(
i
=
0
;
i
<
N
;
++
i
)
dist_map
[
i
]
=
numeric_limits
<
dist_t
>::
max
();
dist_map
[
source
]
=
0
;
try
{
dijkstra_shortest_paths
(
g
,
vertex
(
source
,
g
),
...
...
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