diff --git a/Eigen/src/Sparse/DynamicSparseMatrix.h b/Eigen/src/Sparse/DynamicSparseMatrix.h index 72930bfcc..7119a84bd 100644 --- a/Eigen/src/Sparse/DynamicSparseMatrix.h +++ b/Eigen/src/Sparse/DynamicSparseMatrix.h @@ -128,11 +128,14 @@ class DynamicSparseMatrix /** Set the matrix to zero and reserve the memory for \a reserveSize nonzero coefficients. */ inline void startFill(int reserveSize = 1000) { - int reserveSizePerVector = std::max(reserveSize/outerSize(),4); - for (int j=0; j0) { - m_data[j].clear(); - m_data[j].reserve(reserveSizePerVector); + int reserveSizePerVector = std::max(reserveSize/outerSize(),4); + for (int j=0; j > : ei_traits::type _Lhs; typedef typename ei_cleantype::type _Rhs; enum { - SparseFlags = ((int(_Lhs::Flags)&Diagonal)==Diagonal) ? _Rhs::Flags : _Lhs::Flags, + SparseFlags = ((int(_Lhs::Flags)&Diagonal)==Diagonal) ? int(_Rhs::Flags) : int(_Lhs::Flags), Flags = SparseBit | (SparseFlags&RowMajorBit) }; }; diff --git a/Eigen/src/Sparse/SparseMatrix.h b/Eigen/src/Sparse/SparseMatrix.h index 8aebe4ae2..8ac98d074 100644 --- a/Eigen/src/Sparse/SparseMatrix.h +++ b/Eigen/src/Sparse/SparseMatrix.h @@ -138,7 +138,6 @@ class SparseMatrix */ inline void startFill(int reserveSize = 1000) { -// std::cerr << this << " startFill\n"; setZero(); m_data.reserve(reserveSize); } @@ -161,6 +160,10 @@ class SparseMatrix } m_outerIndex[outer+1] = m_outerIndex[outer]; } + else + { + ei_assert(m_data.index(m_data.size()-1)&>(m);