Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r54703 - trunk/boost/graph
From: jewillco_at_[hidden]
Date: 2009-07-06 00:21:48


Author: jewillco
Date: 2009-07-06 00:21:48 EDT (Mon, 06 Jul 2009)
New Revision: 54703
URL: http://svn.boost.org/trac/boost/changeset/54703

Log:
Made add_vertex and add_vertices work with new CSR interface; fixed add_edges stuff to work with edge properties; refs #3134
Text files modified:
   trunk/boost/graph/compressed_sparse_row_graph.hpp | 8 +++++---
   1 files changed, 5 insertions(+), 3 deletions(-)

Modified: trunk/boost/graph/compressed_sparse_row_graph.hpp
==============================================================================
--- trunk/boost/graph/compressed_sparse_row_graph.hpp (original)
+++ trunk/boost/graph/compressed_sparse_row_graph.hpp 2009-07-06 00:21:48 EDT (Mon, 06 Jul 2009)
@@ -191,7 +191,7 @@
 
   template <int N, typename Result>
   struct my_tuple_get_class {
- typedef Result result_type;
+ typedef const Result& result_type;
     template <typename Tuple>
     result_type operator()(const Tuple& t) const {
       return t.template get<N>();
@@ -1220,7 +1220,8 @@
 inline Vertex
 add_vertex(BOOST_CSR_GRAPH_TYPE& g) {
   Vertex old_num_verts_plus_one = g.m_rowstart.size();
- g.m_rowstart.push_back(EdgeIndex(0));
+ EdgeIndex numedges = g.m_rowstart.back();
+ g.m_rowstart.push_back(numedges);
   g.vertex_properties().resize(num_vertices(g));
   return old_num_verts_plus_one - 1;
 }
@@ -1229,7 +1230,8 @@
 inline Vertex
 add_vertices(typename BOOST_CSR_GRAPH_TYPE::vertices_size_type count, BOOST_CSR_GRAPH_TYPE& g) {
   Vertex old_num_verts_plus_one = g.m_rowstart.size();
- g.m_rowstart.resize(old_num_verts_plus_one + count, EdgeIndex(0));
+ EdgeIndex numedges = g.m_rowstart.back();
+ g.m_rowstart.resize(old_num_verts_plus_one + count, numedges);
   g.vertex_properties().resize(num_vertices(g));
   return old_num_verts_plus_one - 1;
 }


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk