Index: adjacency_matrix.hpp =================================================================== RCS file: /cvsroot/boost/boost/boost/graph/adjacency_matrix.hpp,v retrieving revision 1.40 diff -u -r1.40 adjacency_matrix.hpp --- adjacency_matrix.hpp 17 Jul 2004 15:46:38 -0000 1.40 +++ adjacency_matrix.hpp 19 Jul 2004 17:42:51 -0000 @@ -214,11 +214,15 @@ { ++this->base_reference(); } - else + else if (m_targ < m_n - 1) { // second half ++m_inc; this->base_reference() += m_inc; } + else + { // past-the-end + this->base_reference() += m_n - m_src; + } ++m_targ; } @@ -490,7 +494,7 @@ else { if (v > u) std::swap(u, v); - return m_matrix[u * (u - 1)/2 + v]; + return m_matrix[u * (u + 1)/2 + v]; } } typename Matrix::reference @@ -564,7 +568,7 @@ Graph& g = const_cast(g_); typename Graph::vertices_size_type offset = u * (u + 1) / 2; typename Graph::MatrixIter f = g.m_matrix.begin() + offset; - typename Graph::MatrixIter l = f + u; + typename Graph::MatrixIter l = g.m_matrix.end(); typename Graph::unfiltered_out_edge_iter first(f, u, g.m_vertex_set.size())