diff --git a/surface/include/pcl/surface/3rdparty/poisson4/sparse_matrix.hpp b/surface/include/pcl/surface/3rdparty/poisson4/sparse_matrix.hpp index 24f0a5402..5e54ac786 100644 --- a/surface/include/pcl/surface/3rdparty/poisson4/sparse_matrix.hpp +++ b/surface/include/pcl/surface/3rdparty/poisson4/sparse_matrix.hpp @@ -228,14 +228,18 @@ namespace pcl template void SparseMatrix::SetZero() { - Resize(this->m_N, this->m_M); + // copied from operator *= + for (int i=0; i void SparseMatrix::SetIdentity() { SetZero(); - for(int ij=0; ij < Min( this->Rows(), this->Columns() ); ij++) + for(int ij=0; ij < std::min( rows, _maxEntriesPerRow ); ij++) (*this)(ij,ij) = T(1); } @@ -388,7 +392,7 @@ namespace pcl T alpha,beta,rDotR; int i; - solution.Resize(M.Columns()); + solution.Resize(bb.Dimensions()); solution.SetZero(); d=r=bb;