summaryrefslogtreecommitdiff
path: root/boost/graph/random_spanning_tree.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/graph/random_spanning_tree.hpp')
-rw-r--r--boost/graph/random_spanning_tree.hpp26
1 files changed, 20 insertions, 6 deletions
diff --git a/boost/graph/random_spanning_tree.hpp b/boost/graph/random_spanning_tree.hpp
index 76dc7f2b9a..ee23c5e1ee 100644
--- a/boost/graph/random_spanning_tree.hpp
+++ b/boost/graph/random_spanning_tree.hpp
@@ -95,12 +95,26 @@ namespace boost {
using namespace boost::graph::keywords;
typedef bgl_named_params<P, T, R> params_type;
BOOST_GRAPH_DECLARE_CONVERTED_PARAMETERS(params_type, params)
- random_spanning_tree(g,
- gen,
- arg_pack[_root_vertex | *vertices(g).first],
- arg_pack[_predecessor_map],
- arg_pack[_weight_map | static_property_map<double>(1.)],
- boost::detail::make_color_map_from_arg_pack(g, arg_pack));
+ typedef typename graph_traits<Graph>::vertex_descriptor vertex_descriptor;
+ vertex_descriptor default_vertex = *vertices(g).first;
+ vertex_descriptor start_vertex = arg_pack[_root_vertex | default_vertex];
+ typename boost::parameter::binding<
+ arg_pack_type,
+ boost::graph::keywords::tag::predecessor_map
+ >::type pred_map = arg_pack[_predecessor_map];
+ static_property_map<double> default_weight_map(1.);
+ typename boost::parameter::value_type<
+ arg_pack_type,
+ boost::graph::keywords::tag::weight_map,
+ static_property_map<double>
+ >::type e_w_map = arg_pack[_weight_map | default_weight_map];
+ typename boost::detail::map_maker<
+ Graph,
+ arg_pack_type,
+ boost::graph::keywords::tag::color_map,
+ boost::default_color_type
+ >::map_type c_map = boost::detail::make_color_map_from_arg_pack(g, arg_pack);
+ random_spanning_tree(g, gen, start_vertex, pred_map, e_w_map, c_map);
}
}