|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r52302 - in trunk/boost/graph: . detail
From: jewillco_at_[hidden]
Date: 2009-04-10 14:51:49
Author: jewillco
Date: 2009-04-10 14:51:48 EDT (Fri, 10 Apr 2009)
New Revision: 52302
URL: http://svn.boost.org/trac/boost/changeset/52302
Log:
Trying to fix CSR constructor
Text files modified:
trunk/boost/graph/compressed_sparse_row_graph.hpp | 4 ++--
trunk/boost/graph/detail/indexed_properties.hpp | 12 ++++++++++++
2 files changed, 14 insertions(+), 2 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-04-10 14:51:48 EDT (Fri, 10 Apr 2009)
@@ -239,12 +239,12 @@
// location to insert out edges for vertex v.
std::vector<EdgeIndex>
current_insert_positions(m_rowstart.begin(), m_rowstart.begin() + numverts);
- for (; edge_begin != edge_end; ++edge_begin) {
+ for (; edge_begin != edge_end; ++edge_begin, ++ep_iter) {
vertices_size_type source = edge_begin->first;
EdgeIndex insert_pos = current_insert_positions[source];
++current_insert_positions[source];
m_column[insert_pos] = edge_begin->second;
- inherited_edge_properties::operator[](insert_pos) = edge_begin->second;
+ inherited_edge_properties::write_by_index(insert_pos, *ep_iter);
}
}
Modified: trunk/boost/graph/detail/indexed_properties.hpp
==============================================================================
--- trunk/boost/graph/detail/indexed_properties.hpp (original)
+++ trunk/boost/graph/detail/indexed_properties.hpp 2009-04-10 14:51:48 EDT (Fri, 10 Apr 2009)
@@ -68,6 +68,12 @@
m_vertex_properties.push_back(prop);
}
+ // Write an element by raw index
+ void write_by_index(std::size_t idx, const Property& prop)
+ {
+ m_edge_properties[idx] = prop;
+ }
+
// Access to the derived object
Derived& derived() { return *static_cast<Derived*>(this); }
@@ -133,6 +139,12 @@
m_edge_properties.reserve(n);
}
+ // Write an element by raw index
+ void write_by_index(std::size_t idx, const Property& prop)
+ {
+ m_edge_properties[idx] = prop;
+ }
+
public:
// Add a new property value to the back
void push_back(const Property& prop)
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