|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r50815 - trunk/boost/graph
From: jewillco_at_[hidden]
Date: 2009-01-27 15:19:29
Author: jewillco
Date: 2009-01-27 15:19:29 EST (Tue, 27 Jan 2009)
New Revision: 50815
URL: http://svn.boost.org/trac/boost/changeset/50815
Log:
Changed Johnson ASSP algorithm to use combine rather than + to do reweighting (did not change -, though); fixes #732
Text files modified:
trunk/boost/graph/johnson_all_pairs_shortest.hpp | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
Modified: trunk/boost/graph/johnson_all_pairs_shortest.hpp
==============================================================================
--- trunk/boost/graph/johnson_all_pairs_shortest.hpp (original)
+++ trunk/boost/graph/johnson_all_pairs_shortest.hpp 2009-01-27 15:19:29 EST (Tue, 27 Jan 2009)
@@ -113,7 +113,7 @@
for (tie(e, e_end) = edges(g2); e != e_end; ++e) {
typename Traits2::vertex_descriptor a = source(*e, g2),
b = target(*e, g2);
- put(w_hat, *e, get(w, *e) + get(h, a) - get(h, b));
+ put(w_hat, *e, combine(get(w, *e), (get(h, a) - get(h, b))));
}
for (tie(u, u_end) = vertices(g2); u != u_end; ++u) {
dijkstra_visitor<> dvis;
@@ -123,7 +123,7 @@
if (*u != s && *v != s) {
typename Traits1::vertex_descriptor u1, v1;
u1 = verts1[id2[*u]]; v1 = verts1[id2[*v]];
- D[id2[*u]-1][id2[*v]-1] = get(d, *v) + get(h, *v) - get(h, *u);
+ D[id2[*u]-1][id2[*v]-1] = combine(get(d, *v), (get(h, *v) - get(h, *u)));
}
}
}
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk