Ticket #9368: prim-patch.patch
File prim-patch.patch, 2.4 KB (added by , 9 years ago) |
---|
-
boost/graph/prim_minimum_spanning_tree.hpp
15 15 #include <boost/graph/dijkstra_shortest_paths.hpp> 16 16 17 17 namespace boost { 18 18 19 19 namespace detail { 20 20 // this should be somewhere else in boost... 21 21 template <class U, class V> struct _project2nd { … … 36 36 Weight) 37 37 { 38 38 typedef typename property_traits<Weight>::value_type W; 39 std::less<W> compare;40 39 detail::_project2nd<W,W> combine; 41 dijkstra_shortest_paths (G, s, params.distance_compare(compare).42 40 dijkstra_shortest_paths 41 (G, s, params.distance_combine(combine)); 43 42 } 44 43 } // namespace detail 45 44 46 template <class VertexListGraph, class DijkstraVisitor, 45 template <class VertexListGraph, class DijkstraVisitor, 47 46 class PredecessorMap, class DistanceMap, 48 class WeightMap, class IndexMap> 47 class WeightMap, class IndexMap, class BinaryPredicate, 48 class DistZero, class DistInf> 49 49 inline void 50 50 prim_minimum_spanning_tree 51 51 (const VertexListGraph& g, 52 typename graph_traits<VertexListGraph>::vertex_descriptor s, 53 PredecessorMap predecessor, DistanceMap distance, WeightMap weight, 52 typename graph_traits<VertexListGraph>::vertex_descriptor s, 53 PredecessorMap predecessor, DistanceMap distance, WeightMap weight, 54 BinaryPredicate compare, DistZero zero, DistInf inf, 54 55 IndexMap index_map, 55 56 DijkstraVisitor vis) 56 57 { 57 58 typedef typename property_traits<WeightMap>::value_type W; 58 std::less<W> compare;59 59 detail::_project2nd<W,W> combine; 60 60 dijkstra_shortest_paths(g, s, predecessor, distance, weight, index_map, 61 compare, combine, (std::numeric_limits<W>::max)(), 0,61 compare, combine, inf, zero, 62 62 vis); 63 63 } 64 64 … … 70 70 const bgl_named_params<P,T,R>& params) 71 71 { 72 72 detail::prim_mst_impl 73 (g, 74 choose_param(get_param(params, root_vertex_t()), *vertices(g).first), 73 (g, 74 choose_param(get_param(params, root_vertex_t()), *vertices(g).first), 75 75 params.predecessor_map(p_map), 76 76 choose_const_pmap(get_param(params, edge_weight), g, edge_weight)); 77 77 }