diff --git a/include/boost/graph/astar_search.hpp b/include/boost/graph/astar_search.hpp index 6db52d6a..fc1993d4 100644 --- a/include/boost/graph/astar_search.hpp +++ b/include/boost/graph/astar_search.hpp @@ -15,13 +15,15 @@ #include +#include #include #include -#include #include -#include #include #include +#include +#include +#include namespace boost { @@ -253,15 +255,13 @@ namespace boost { CompareFunction compare, CombineFunction combine, CostInf inf, CostZero zero) { - typedef indirect_cmp IndirectCmp; - IndirectCmp icmp(cost, compare); - typedef typename graph_traits::vertex_descriptor Vertex; - typedef mutable_queue, - IndirectCmp, VertexIndexMap> + typedef boost::vector_property_map IndexInHeapMap; + IndexInHeapMap index_in_heap; + typedef d_ary_heap_indirect MutableQueue; - MutableQueue Q(num_vertices(g), icmp, index_map); + MutableQueue Q(cost, index_in_heap, compare); detail::astar_bfs_visitor::value_type D; - typename std::vector::size_type - n = is_default_param(distance) ? num_vertices(g) : 1; - std::vector distance_map(n); - n = is_default_param(cost) ? num_vertices(g) : 1; - std::vector cost_map(n); - std::vector color_map(num_vertices(g)); - default_color_type c = white_color; + std::vector distance_map; + std::vector cost_map; + std::vector color_map; detail::astar_dispatch2 (g, s, h, - choose_param(cost, make_iterator_property_map - (cost_map.begin(), index_map, - cost_map[0])), - choose_param(distance, make_iterator_property_map - (distance_map.begin(), index_map, - distance_map[0])), + choose_param(cost, vector_property_map(index_map)), + choose_param(distance, vector_property_map(index_map)), weight, index_map, - choose_param(color, make_iterator_property_map - (color_map.begin(), index_map, c)), + choose_param(color, vector_property_map(index_map)), params); } } // namespace detail