& params, ColorMap color) { return edmunds_karp_max_flow (g, src, sink, choose_const_pmap(get_param(params, edge_capacity), g, edge_capacity), choose_pmap(get_param(params, edge_residual_capacity), g, edge_residual_capacity), choose_const_pmap(get_param(params, edge_reverse), g, edge_reverse), color, pred); } }; template<> struct edmunds_karp_dispatch2 { template static typename edge_capacity_value::type apply (Graph& g, typename graph_traits::vertex_descriptor src, typename graph_traits::vertex_descriptor sink, PredMap pred, const bgl_named_params& params, detail::error_property_not_found) { typedef typename graph_traits::edge_descriptor edge_descriptor; typedef typename graph_traits::vertices_size_type size_type; size_type n = is_default_param(get_param(params, vertex_color)) ? num_vertices(g) : 1; std::vector color_vec(n); return edmunds_karp_max_flow (g, src, sink, choose_const_pmap(get_param(params, edge_capacity), g, edge_capacity), choose_pmap(get_param(params, edge_residual_capacity), g, edge_residual_capacity), choose_const_pmap(get_param(params, edge_reverse), g, edge_reverse), make_iterator_property_map(color_vec.begin(), choose_const_pmap (get_param(params, vertex_index), g, vertex_index), color_vec[0]), pred); } }; //------------------------------------------------------------------------- // Handle default for predecessor property map // use of class here is a VC++ workaround template struct edmunds_karp_dispatch1 { template static typename edge_capacity_value::type apply(Graph& g, typename graph_traits::vertex_descriptor src, typename graph_traits::vertex_descriptor sink, const bgl_named_params& params, PredMap pred) { typedef typename property_value< bgl_named_params, vertex_color_t>::type C; return edmunds_karp_dispatch2::apply (g, src, sink, pred, params, get_param(params, vertex_color)); } }; template<> struct edmunds_karp_dispatch1 { template static typename edge_capacity_value::type apply (Graph& g, typename graph_traits::vertex_descriptor src, typename graph_traits::vertex_descriptor sink, const bgl_named_params& params, detail::error_property_not_found) { typedef typename graph_traits::edge_descriptor edge_descriptor; typedef typename graph_traits::vertices_size_type size_type; size_type n = is_default_param(get_param(params, vertex_predecessor)) ? num_vertices(g) : 1; std::vector pred_vec(n); typedef typename property_value< bgl_named_params, vertex_color_t>::type C; return edmunds_karp_dispatch2::apply (g, src, sink, make_iterator_property_map(pred_vec.begin(), choose_const_pmap (get_param(params, vertex_index), g, vertex_index), pred_vec[0]), params, get_param(params, vertex_color)); } }; } // namespace detail template typename detail::edge_capacity_value::type edmunds_karp_max_flow (Graph& g, typename graph_traits::vertex_descriptor src, typename graph_traits::vertex_descriptor sink, const bgl_named_params& params) { typedef typename property_value< bgl_named_params, vertex_predecessor_t>::type Pred; return detail::edmunds_karp_dispatch1::apply (g, src, sink, params, get_param(params, vertex_predecessor)); } template typename property_traits< typename property_map::const_type >::value_type edmunds_karp_max_flow (Graph& g, typename graph_traits::vertex_descriptor src, typename graph_traits::vertex_descriptor sink) { bgl_named_params params(0); return edmunds_karp_max_flow(g, src, sink, params); } } // namespace boost #endif // EDMUNDS_KARP_MAX_FLOW_HPP
& params, detail::error_property_not_found) { typedef typename graph_traits::edge_descriptor edge_descriptor; typedef typename graph_traits::vertices_size_type size_type; size_type n = is_default_param(get_param(params, vertex_color)) ? num_vertices(g) : 1; std::vector color_vec(n); return edmunds_karp_max_flow (g, src, sink, choose_const_pmap(get_param(params, edge_capacity), g, edge_capacity), choose_pmap(get_param(params, edge_residual_capacity), g, edge_residual_capacity), choose_const_pmap(get_param(params, edge_reverse), g, edge_reverse), make_iterator_property_map(color_vec.begin(), choose_const_pmap (get_param(params, vertex_index), g, vertex_index), color_vec[0]), pred); } }; //------------------------------------------------------------------------- // Handle default for predecessor property map // use of class here is a VC++ workaround template struct edmunds_karp_dispatch1 { template static typename edge_capacity_value::type apply(Graph& g, typename graph_traits::vertex_descriptor src, typename graph_traits::vertex_descriptor sink, const bgl_named_params& params, PredMap pred) { typedef typename property_value< bgl_named_params, vertex_color_t>::type C; return edmunds_karp_dispatch2::apply (g, src, sink, pred, params, get_param(params, vertex_color)); } }; template<> struct edmunds_karp_dispatch1 { template static typename edge_capacity_value::type apply (Graph& g, typename graph_traits::vertex_descriptor src, typename graph_traits::vertex_descriptor sink, const bgl_named_params& params, detail::error_property_not_found) { typedef typename graph_traits::edge_descriptor edge_descriptor; typedef typename graph_traits::vertices_size_type size_type; size_type n = is_default_param(get_param(params, vertex_predecessor)) ? num_vertices(g) : 1; std::vector pred_vec(n); typedef typename property_value< bgl_named_params, vertex_color_t>::type C; return edmunds_karp_dispatch2::apply (g, src, sink, make_iterator_property_map(pred_vec.begin(), choose_const_pmap (get_param(params, vertex_index), g, vertex_index), pred_vec[0]), params, get_param(params, vertex_color)); } }; } // namespace detail template typename detail::edge_capacity_value::type edmunds_karp_max_flow (Graph& g, typename graph_traits::vertex_descriptor src, typename graph_traits::vertex_descriptor sink, const bgl_named_params& params) { typedef typename property_value< bgl_named_params, vertex_predecessor_t>::type Pred; return detail::edmunds_karp_dispatch1::apply (g, src, sink, params, get_param(params, vertex_predecessor)); } template typename property_traits< typename property_map::const_type >::value_type edmunds_karp_max_flow (Graph& g, typename graph_traits::vertex_descriptor src, typename graph_traits::vertex_descriptor sink) { bgl_named_params params(0); return edmunds_karp_max_flow(g, src, sink, params); } } // namespace boost #endif // EDMUNDS_KARP_MAX_FLOW_HPP
& params, PredMap pred) { typedef typename property_value< bgl_named_params
, vertex_color_t>::type C; return edmunds_karp_dispatch2::apply (g, src, sink, pred, params, get_param(params, vertex_color)); } }; template<> struct edmunds_karp_dispatch1 { template static typename edge_capacity_value::type apply (Graph& g, typename graph_traits::vertex_descriptor src, typename graph_traits::vertex_descriptor sink, const bgl_named_params& params, detail::error_property_not_found) { typedef typename graph_traits::edge_descriptor edge_descriptor; typedef typename graph_traits::vertices_size_type size_type; size_type n = is_default_param(get_param(params, vertex_predecessor)) ? num_vertices(g) : 1; std::vector pred_vec(n); typedef typename property_value< bgl_named_params, vertex_color_t>::type C; return edmunds_karp_dispatch2::apply (g, src, sink, make_iterator_property_map(pred_vec.begin(), choose_const_pmap (get_param(params, vertex_index), g, vertex_index), pred_vec[0]), params, get_param(params, vertex_color)); } }; } // namespace detail template typename detail::edge_capacity_value::type edmunds_karp_max_flow (Graph& g, typename graph_traits::vertex_descriptor src, typename graph_traits::vertex_descriptor sink, const bgl_named_params& params) { typedef typename property_value< bgl_named_params, vertex_predecessor_t>::type Pred; return detail::edmunds_karp_dispatch1::apply (g, src, sink, params, get_param(params, vertex_predecessor)); } template typename property_traits< typename property_map::const_type >::value_type edmunds_karp_max_flow (Graph& g, typename graph_traits::vertex_descriptor src, typename graph_traits::vertex_descriptor sink) { bgl_named_params params(0); return edmunds_karp_max_flow(g, src, sink, params); } } // namespace boost #endif // EDMUNDS_KARP_MAX_FLOW_HPP
& params, detail::error_property_not_found) { typedef typename graph_traits::edge_descriptor edge_descriptor; typedef typename graph_traits::vertices_size_type size_type; size_type n = is_default_param(get_param(params, vertex_predecessor)) ? num_vertices(g) : 1; std::vector pred_vec(n); typedef typename property_value< bgl_named_params, vertex_color_t>::type C; return edmunds_karp_dispatch2::apply (g, src, sink, make_iterator_property_map(pred_vec.begin(), choose_const_pmap (get_param(params, vertex_index), g, vertex_index), pred_vec[0]), params, get_param(params, vertex_color)); } }; } // namespace detail template typename detail::edge_capacity_value::type edmunds_karp_max_flow (Graph& g, typename graph_traits::vertex_descriptor src, typename graph_traits::vertex_descriptor sink, const bgl_named_params& params) { typedef typename property_value< bgl_named_params, vertex_predecessor_t>::type Pred; return detail::edmunds_karp_dispatch1::apply (g, src, sink, params, get_param(params, vertex_predecessor)); } template typename property_traits< typename property_map::const_type >::value_type edmunds_karp_max_flow (Graph& g, typename graph_traits::vertex_descriptor src, typename graph_traits::vertex_descriptor sink) { bgl_named_params params(0); return edmunds_karp_max_flow(g, src, sink, params); } } // namespace boost #endif // EDMUNDS_KARP_MAX_FLOW_HPP
, vertex_color_t>::type C; return edmunds_karp_dispatch2::apply (g, src, sink, make_iterator_property_map(pred_vec.begin(), choose_const_pmap (get_param(params, vertex_index), g, vertex_index), pred_vec[0]), params, get_param(params, vertex_color)); } }; } // namespace detail template typename detail::edge_capacity_value::type edmunds_karp_max_flow (Graph& g, typename graph_traits::vertex_descriptor src, typename graph_traits::vertex_descriptor sink, const bgl_named_params& params) { typedef typename property_value< bgl_named_params, vertex_predecessor_t>::type Pred; return detail::edmunds_karp_dispatch1::apply (g, src, sink, params, get_param(params, vertex_predecessor)); } template typename property_traits< typename property_map::const_type >::value_type edmunds_karp_max_flow (Graph& g, typename graph_traits::vertex_descriptor src, typename graph_traits::vertex_descriptor sink) { bgl_named_params params(0); return edmunds_karp_max_flow(g, src, sink, params); } } // namespace boost #endif // EDMUNDS_KARP_MAX_FLOW_HPP
& params) { typedef typename property_value< bgl_named_params
, vertex_predecessor_t>::type Pred; return detail::edmunds_karp_dispatch1::apply (g, src, sink, params, get_param(params, vertex_predecessor)); } template typename property_traits< typename property_map::const_type >::value_type edmunds_karp_max_flow (Graph& g, typename graph_traits::vertex_descriptor src, typename graph_traits::vertex_descriptor sink) { bgl_named_params params(0); return edmunds_karp_max_flow(g, src, sink, params); } } // namespace boost #endif // EDMUNDS_KARP_MAX_FLOW_HPP