diff --git a/include/boost/graph/boykov_kolmogorov_max_flow.hpp b/include/boost/graph/boykov_kolmogorov_max_flow.hpp index bd624d56d..eb0189eb5 100644 --- a/include/boost/graph/boykov_kolmogorov_max_flow.hpp +++ b/include/boost/graph/boykov_kolmogorov_max_flow.hpp @@ -1029,8 +1029,7 @@ boykov_kolmogorov_max_flow(Graph& g, CapacityEdgeMap cap, * named-parameter version, some given */ template < class Graph, class P, class T, class R > -typename property_traits< - typename property_map< Graph, edge_capacity_t >::const_type >::value_type +typename detail::edge_capacity_value< Graph, P, T, R >::type boykov_kolmogorov_max_flow(Graph& g, typename graph_traits< Graph >::vertex_descriptor src, typename graph_traits< Graph >::vertex_descriptor sink, diff --git a/test/boykov_kolmogorov_max_flow_test.cpp b/test/boykov_kolmogorov_max_flow_test.cpp index 44ce8f86f..a2a6e6f31 100644 --- a/test/boykov_kolmogorov_max_flow_test.cpp +++ b/test/boykov_kolmogorov_max_flow_test.cpp @@ -72,7 +72,7 @@ fill_random_max_flow_graph(Graph& g, CapacityMap cap, ReverseEdgeMap rev, // cannot use this, as we have no idea how properties are stored, right? typename graph_traits< Graph >::edge_iterator ei, e_end; for (boost::tie(ei, e_end) = edges(g); ei != e_end; ++ei) - cap[*ei] = int_gen(); + put(cap, *ei, int_gen()); // get source and sink node vertex_descriptor s = random_vertex(g, gen); @@ -96,9 +96,9 @@ fill_random_max_flow_graph(Graph& g, CapacityMap cap, ReverseEdgeMap rev, boost::tie(new_edge, inserted) = add_edge(source_vertex, target_vertex, g); assert(inserted); - rev[old_edge] = new_edge; - rev[new_edge] = old_edge; - cap[new_edge] = 0; + put(rev, old_edge, new_edge); + put(rev, new_edge, old_edge); + put(cap, new_edge, 0); } return std::make_pair(s, t); } @@ -188,10 +188,24 @@ long test_bundled_properties(int n_verts, int n_edges, std::size_t seed) boost::tie(src, sink) = fill_random_max_flow_graph(g, get(&tEdge::edge_capacity, g), get(&tEdge::edge_reverse, g), n_verts, n_edges, seed); - return boykov_kolmogorov_max_flow(g, get(&tEdge::edge_capacity, g), - get(&tEdge::edge_residual_capacity, g), get(&tEdge::edge_reverse, g), - get(&tVertex::vertex_predecessor, g), get(&tVertex::vertex_color, g), - get(&tVertex::vertex_distance, g), get(vertex_index, g), src, sink); + + long flow_unnamed_overload = boykov_kolmogorov_max_flow(g, + get(&tEdge::edge_capacity, g), get(&tEdge::edge_residual_capacity, g), + get(&tEdge::edge_reverse, g), get(&tVertex::vertex_predecessor, g), + get(&tVertex::vertex_color, g), get(&tVertex::vertex_distance, g), + get(vertex_index, g), src, sink); + + long flow_named_overload = boykov_kolmogorov_max_flow(g, src, sink, + capacity_map(get(&tEdge::edge_capacity, g)) + .residual_capacity_map(get(&tEdge::edge_residual_capacity, g)) + .reverse_edge_map(get(&tEdge::edge_reverse, g)) + .predecessor_map(get(&tVertex::vertex_predecessor, g)) + .color_map(get(&tVertex::vertex_color, g)) + .distance_map(get(&tVertex::vertex_distance, g)) + .vertex_index_map(get(vertex_index, g))); + + BOOST_TEST(flow_unnamed_overload == flow_named_overload); + return flow_named_overload; } long test_overloads(int n_verts, int n_edges, std::size_t seed)