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

Fixed relax logic to not write predecessor map unless distance was actually changed in memory (although this case will never be hit unless registers have extra precision compared to memory); fixes #7226

[SVN r80639]
This commit is contained in:
Jeremiah Willcock
2012-09-22 19:32:32 +00:00
parent 8afe81608c
commit f16a1b114d

View File

@@ -53,17 +53,26 @@ namespace boost {
const D d_v = get(d, v);
const W& w_e = get(w, e);
// The redundant gets in the return statements are to ensure that extra
// floating-point precision in x87 registers does not lead to relax()
// returning true when the distance did not actually change.
// The seemingly redundant comparisons after the distance puts are to
// ensure that extra floating-point precision in x87 registers does not
// lead to relax() returning true when the distance did not actually
// change.
if ( compare(combine(d_u, w_e), d_v) ) {
put(d, v, combine(d_u, w_e));
put(p, v, u);
return compare(get(d, v), d_v);
if (compare(get(d, v), d_v)) {
put(p, v, u);
return true;
} else {
return false;
}
} else if (is_undirected && compare(combine(d_v, w_e), d_u)) {
put(d, u, combine(d_v, w_e));
put(p, u, v);
return compare(get(d, u), d_u);
if (compare(get(d, u), d_u)) {
put(p, u, v);
return true;
} else {
return false;
}
} else
return false;
}