From 3b8938ee1a74fb481aea90a2f1ec9eb6f33b45b8 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Tue, 6 Oct 2009 10:36:59 +0200 Subject: [PATCH] backport d97d307fcfc9c9421562705db7bf734865dfd53b --- Eigen/src/Sparse/SparseMatrix.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Eigen/src/Sparse/SparseMatrix.h b/Eigen/src/Sparse/SparseMatrix.h index 3f09596bc..56ea65888 100644 --- a/Eigen/src/Sparse/SparseMatrix.h +++ b/Eigen/src/Sparse/SparseMatrix.h @@ -259,9 +259,11 @@ class SparseMatrix m_data.resize(k,0); } + /** Resizes the matrix to a \a rows x \a cols matrix and initializes it to zero + * \sa resizeNonZeros(int), reserve(), setZero() + */ void resize(int rows, int cols) { -// std::cerr << this << " resize " << rows << "x" << cols << "\n"; const int outerSize = IsRowMajor ? rows : cols; m_innerSize = IsRowMajor ? cols : rows; m_data.clear(); @@ -270,8 +272,8 @@ class SparseMatrix delete[] m_outerIndex; m_outerIndex = new int [outerSize+1]; m_outerSize = outerSize; - memset(m_outerIndex, 0, (m_outerSize+1)*sizeof(int)); } + memset(m_outerIndex, 0, (m_outerSize+1)*sizeof(int)); } void resizeNonZeros(int size) {