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
Malte R
graph-tool
Commits
fe5ec4e9
Commit
fe5ec4e9
authored
Sep 24, 2017
by
Tiago Peixoto
Browse files
Fix compilation with Boost < 1.60
parent
8180fd35
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/graph/topology/graph_distance.cc
View file @
fe5ec4e9
...
...
@@ -30,7 +30,10 @@
#include
<boost/graph/bellman_ford_shortest_paths.hpp>
#include
<boost/python/stl_iterator.hpp>
#include
<boost/python.hpp>
#include
<boost/math/special_functions/relative_difference.hpp>
#if (BOOST_VERSION >= 106000)
# include <boost/math/special_functions/relative_difference.hpp>
#endif
using
namespace
std
;
using
namespace
boost
;
...
...
@@ -464,15 +467,20 @@ void get_all_preds(Graph g, Dist dist, Pred pred, Weight weight, Preds preds,
for
(
auto
e
:
in_or_out_edges_range
(
v
,
g
))
{
auto
u
=
boost
::
is_directed
(
g
)
?
source
(
e
,
g
)
:
target
(
e
,
g
);
if
(
std
::
is_floating_point
<
dist_t
>::
value
)
if
(
!
std
::
is_floating_point
<
dist_t
>::
value
)
{
if
(
dist_t
(
dist
[
u
]
+
get
(
weight
,
e
))
==
d
)
preds
[
v
].
push_back
(
u
);
}
else
{
#if (BOOST_VERSION >= 106000)
if
(
boost
::
math
::
relative_difference
(
dist_t
(
dist
[
u
]
+
get
(
weight
,
e
)),
d
)
<
epsilon
)
preds
[
v
].
push_back
(
u
);
#else
if
(
abs
(
dist_t
(
dist
[
u
]
+
get
(
weight
,
e
))
-
d
)
<
epsilon
)
preds
[
v
].
push_back
(
u
);
#endif
}
}
});
...
...
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