From bc707a8f6737196d3de5222d95d3fe712cdfaf0b Mon Sep 17 00:00:00 2001 From: Andrew Sutton Date: Mon, 8 Dec 2008 15:06:05 +0000 Subject: [PATCH] Whitespace cleanup. [SVN r50188] --- include/boost/graph/astar_search.hpp | 98 ++++++++++++++-------------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/include/boost/graph/astar_search.hpp b/include/boost/graph/astar_search.hpp index e1b95c4a..6db52d6a 100644 --- a/include/boost/graph/astar_search.hpp +++ b/include/boost/graph/astar_search.hpp @@ -26,7 +26,7 @@ namespace boost { - + template struct AStarHeuristicConcept { void constraints() @@ -37,8 +37,8 @@ namespace boost { Heuristic h; typename graph_traits::vertex_descriptor u; }; - - + + template class astar_heuristic : public std::unary_function< typename graph_traits::vertex_descriptor, CostType> @@ -48,9 +48,9 @@ namespace boost { astar_heuristic() {} CostType operator()(Vertex u) { return static_cast(0); } }; - - + + template struct AStarVisitorConcept { void constraints() @@ -70,22 +70,22 @@ namespace boost { typename graph_traits::vertex_descriptor u; typename graph_traits::edge_descriptor e; }; - - + + template class astar_visitor : public bfs_visitor { public: astar_visitor() {} astar_visitor(Visitors vis) : bfs_visitor(vis) {} - + template void edge_relaxed(Edge e, Graph& g) { invoke_visitors(this->m_vis, e, g, on_edge_relaxed()); } template void edge_not_relaxed(Edge e, Graph& g) { - invoke_visitors(this->m_vis, e, g, on_edge_not_relaxed()); + invoke_visitors(this->m_vis, e, g, on_edge_not_relaxed()); } private: template @@ -99,10 +99,10 @@ namespace boost { return astar_visitor(vis); } typedef astar_visitor<> default_astar_visitor; - + namespace detail { - + template struct astar_bfs_visitor { - + typedef typename property_traits::value_type C; typedef typename property_traits::value_type ColorValue; typedef color_traits Color; typedef typename property_traits::value_type distance_type; - + astar_bfs_visitor(AStarHeuristic h, UniformCostVisitor vis, UpdatableQueue& Q, PredecessorMap p, CostMap c, DistanceMap d, WeightMap w, @@ -124,8 +124,8 @@ namespace boost { : m_h(h), m_vis(vis), m_Q(Q), m_predecessor(p), m_cost(c), m_distance(d), m_weight(w), m_color(col), m_combine(combine), m_compare(compare), m_zero(zero) {} - - + + template void initialize_vertex(Vertex u, Graph& g) { m_vis.initialize_vertex(u, g); @@ -143,16 +143,16 @@ namespace boost { m_vis.finish_vertex(u, g); } template - void examine_edge(Edge e, Graph& g) { + void examine_edge(Edge e, Graph& g) { if (m_compare(get(m_weight, e), m_zero)) throw negative_edge(); m_vis.examine_edge(e, g); } template void non_tree_edge(Edge, Graph&) {} - - - + + + template void tree_edge(Edge e, Graph& g) { m_decreased = relax(e, g, m_weight, m_predecessor, m_distance, @@ -166,8 +166,8 @@ namespace boost { } else m_vis.edge_not_relaxed(e, g); } - - + + template void gray_target(Edge e, Graph& g) { distance_type old_distance = get(m_distance, target(e, g)); @@ -192,8 +192,8 @@ namespace boost { } else m_vis.edge_not_relaxed(e, g); } - - + + template void black_target(Edge e, Graph& g) { distance_type old_distance = get(m_distance, target(e, g)); @@ -213,9 +213,9 @@ namespace boost { } else m_vis.edge_not_relaxed(e, g); } - - - + + + AStarHeuristic m_h; UniformCostVisitor m_vis; UpdatableQueue& m_Q; @@ -228,13 +228,13 @@ namespace boost { BinaryPredicate m_compare; bool m_decreased; C m_zero; - + }; - + } // namespace detail - - + + template IndirectCmp; IndirectCmp icmp(cost, compare); - + typedef typename graph_traits::vertex_descriptor Vertex; typedef mutable_queue, IndirectCmp, VertexIndexMap> MutableQueue; MutableQueue Q(num_vertices(g), icmp, index_map); - + detail::astar_bfs_visitor bfs_vis(h, vis, Q, predecessor, cost, distance, weight, color, combine, compare, zero); - + breadth_first_visit(g, s, Q, bfs_vis, color); } - - + + // Non-named parameter interface template ::value_type ColorValue; typedef color_traits Color; typename graph_traits::vertex_iterator ui, ui_end; @@ -305,15 +305,15 @@ namespace boost { } put(distance, s, zero); put(cost, s, h(s)); - + astar_search_no_init (g, s, h, vis, predecessor, cost, distance, weight, color, index_map, compare, combine, inf, zero); - + } - - - + + + namespace detail { template @@ -363,14 +363,14 @@ namespace boost { std::vector cost_map(n); std::vector color_map(num_vertices(g)); default_color_type c = white_color; - + 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.begin(), index_map, distance_map[0])), weight, index_map, choose_param(color, make_iterator_property_map @@ -378,8 +378,8 @@ namespace boost { params); } } // namespace detail - - + + // Named parameter interface template ::vertex_descriptor s, AStarHeuristic h, const bgl_named_params& params) { - + detail::astar_dispatch1 (g, s, h, get_param(params, vertex_rank), @@ -399,9 +399,9 @@ namespace boost { choose_const_pmap(get_param(params, vertex_index), g, vertex_index), get_param(params, vertex_color), params); - + } - + } // namespace boost #endif // BOOST_GRAPH_ASTAR_SEARCH_HPP