From 708d8b62a59d84aa704dbb8cdc5ffec759849d47 Mon Sep 17 00:00:00 2001 From: Jeremiah Willcock Date: Sat, 30 Jun 2012 20:22:16 +0000 Subject: [PATCH] Second batch of Boost.Graph and Boost.PropertyMap changes for 1.51 [SVN r79191] --- doc/bundles.html | 2 +- .../graph/compressed_sparse_row_graph.hpp | 122 +----------------- include/boost/graph/grid_graph.hpp | 5 +- src/graphml.cpp | 4 + 4 files changed, 10 insertions(+), 123 deletions(-) diff --git a/doc/bundles.html b/doc/bundles.html index 340b9483..4b789b0a 100644 --- a/doc/bundles.html +++ b/doc/bundles.html @@ -93,7 +93,7 @@ typedef boost::adjacency_list< boost::property<zipcodes_t, std::vector<int> > > >, // Edge properties boost::property<boost::edge_name_t, std::string, - boost::property<boost::edge_length_t, double, + boost::property<boost::edge_weight_t, double, boost::property<edge_speed_limit_t, int, boost::property<edge_lanes_t, int, boost::property<edge_divided, bool> > > > > > diff --git a/include/boost/graph/compressed_sparse_row_graph.hpp b/include/boost/graph/compressed_sparse_row_graph.hpp index 50b2a335..1a1cd674 100644 --- a/include/boost/graph/compressed_sparse_row_graph.hpp +++ b/include/boost/graph/compressed_sparse_row_graph.hpp @@ -929,6 +929,7 @@ class compressed_sparse_row_graph - void - add_edges_sorted_internal( - BidirectionalIteratorOrig first_sorted, - BidirectionalIteratorOrig last_sorted, - EPIterOrig ep_iter_sorted, - const GlobalToLocal& global_to_local) { - m_forward.add_edges_sorted_internal(first_sorted, last_sorted, ep_iter_sorted, global_to_local); - } - - template - void - add_edges_sorted_internal( - BidirectionalIteratorOrig first_sorted, - BidirectionalIteratorOrig last_sorted, - EPIterOrig ep_iter_sorted) { - m_forward.add_edges_sorted_internal(first_sorted, last_sorted, ep_iter_sorted, typed_identity_property_map()); - } - - // Add edges from a sorted (smallest sources first) range of pairs - template - void - add_edges_sorted_internal( - BidirectionalIteratorOrig first_sorted, - BidirectionalIteratorOrig last_sorted) { - m_forward.add_edges_sorted_internal(first_sorted, last_sorted, detail::default_construct_iterator()); - } - - template - void - add_edges_sorted_internal_global( - BidirectionalIteratorOrig first_sorted, - BidirectionalIteratorOrig last_sorted, - const GlobalToLocal& global_to_local) { - m_forward.add_edges_sorted_internal(first_sorted, last_sorted, detail::default_construct_iterator(), global_to_local); - } - - template - void - add_edges_sorted_internal_global( - BidirectionalIteratorOrig first_sorted, - BidirectionalIteratorOrig last_sorted, - EPIterOrig ep_iter_sorted, - const GlobalToLocal& global_to_local) { - m_forward.add_edges_sorted_internal(first_sorted, last_sorted, ep_iter_sorted, global_to_local); - } - - // Add edges from a range of (source, target) pairs that are unsorted - template - inline void - add_edges_internal(InputIterator first, InputIterator last, - const GlobalToLocal& global_to_local) { - typedef compressed_sparse_row_graph Graph; - typedef typename boost::graph_traits::vertex_descriptor vertex_t; - typedef typename boost::graph_traits::vertices_size_type vertex_num; - typedef typename boost::graph_traits::edges_size_type edge_num; - typedef std::vector > edge_vector_t; - edge_vector_t new_edges(first, last); - if (new_edges.empty()) return; - std::sort(new_edges.begin(), new_edges.end()); - this->add_edges_sorted_internal_global(new_edges.begin(), new_edges.end(), global_to_local); - } - - template - inline void - add_edges_internal(InputIterator first, InputIterator last) { - this->add_edges_internal(first, last, typed_identity_property_map()); - } - - // Add edges from a range of (source, target) pairs and edge properties that - // are unsorted - template - inline void - add_edges_internal(InputIterator first, InputIterator last, - EPIterator ep_iter, EPIterator ep_iter_end, - const GlobalToLocal& global_to_local) { - typedef compressed_sparse_row_graph Graph; - typedef typename boost::graph_traits::vertex_descriptor vertex_t; - typedef typename boost::graph_traits::vertices_size_type vertex_num; - typedef typename boost::graph_traits::edges_size_type edge_num; - typedef std::pair vertex_pair; - typedef std::vector< - boost::tuple > - edge_vector_t; - edge_vector_t new_edges - (boost::make_zip_iterator(boost::make_tuple(first, ep_iter)), - boost::make_zip_iterator(boost::make_tuple(last, ep_iter_end))); - if (new_edges.empty()) return; - std::sort(new_edges.begin(), new_edges.end(), - boost::detail::compare_first< - std::less >()); - m_forward.add_edges_sorted_internal - (boost::make_transform_iterator( - new_edges.begin(), - boost::detail::my_tuple_get_class<0, vertex_pair>()), - boost::make_transform_iterator( - new_edges.end(), - boost::detail::my_tuple_get_class<0, vertex_pair>()), - boost::make_transform_iterator( - new_edges.begin(), - boost::detail::my_tuple_get_class - <1, edge_bundled>()), - global_to_local); - } - - // Add edges from a range of (source, target) pairs and edge properties that - // are unsorted - template - inline void - add_edges_internal(InputIterator first, InputIterator last, - EPIterator ep_iter, EPIterator ep_iter_end) { - this->add_edges_internal(first, last, ep_iter, ep_iter_end, typed_identity_property_map()); + set_up_backward_property_links(); } using inherited_vertex_properties::operator[]; diff --git a/include/boost/graph/grid_graph.hpp b/include/boost/graph/grid_graph.hpp index f63f3d01..7bb37324 100644 --- a/include/boost/graph/grid_graph.hpp +++ b/include/boost/graph/grid_graph.hpp @@ -17,7 +17,6 @@ #include #include #include -#include #include #include #include @@ -63,14 +62,14 @@ namespace boost { grid_graph_index_map() { } grid_graph_index_map(const Graph& graph) : - m_graph(make_shared(graph)) { } + m_graph(&graph) { } value_type operator[](key_type key) const { return (m_graph->index_of(key)); } protected: - shared_ptr m_graph; + const Graph* m_graph; }; template diff --git a/src/graphml.cpp b/src/graphml.cpp index 3571b06f..4a17fcaa 100644 --- a/src/graphml.cpp +++ b/src/graphml.cpp @@ -21,6 +21,8 @@ using namespace boost; +namespace { + class graphml_reader { public: @@ -202,6 +204,8 @@ private: std::vector m_edge; }; +} + namespace boost { void BOOST_GRAPH_DECL