2
0
mirror of https://github.com/boostorg/graph.git synced 2026-02-11 11:52:12 +00:00

added check for overflow

[SVN r10198]
This commit is contained in:
Jeremy Siek
2001-05-23 16:40:46 +00:00
parent db5a2b138d
commit bed761e2c2

View File

@@ -55,6 +55,10 @@ namespace boost {
D d_u = get(d, u), d_v = get(d, v);
W w_e = get(w, e);
// workaround overflow problem, don't relax if d_u is close to inf
if (std::abs(std::numeric_limits<D>::max() - d_u) < std::abs(w_e))
return false;
if ( compare(combine(d_u, w_e), d_v) ) {
put(d, v, combine(d_u, w_e));
put(p, v, u);