sparse_matrix.patch 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. diff --git a/surface/include/pcl/surface/3rdparty/poisson4/sparse_matrix.hpp b/surface/include/pcl/surface/3rdparty/poisson4/sparse_matrix.hpp
  2. index 24f0a5402..5e54ac786 100644
  3. --- a/surface/include/pcl/surface/3rdparty/poisson4/sparse_matrix.hpp
  4. +++ b/surface/include/pcl/surface/3rdparty/poisson4/sparse_matrix.hpp
  5. @@ -228,14 +228,18 @@ namespace pcl
  6. template<class T>
  7. void SparseMatrix<T>::SetZero()
  8. {
  9. - Resize(this->m_N, this->m_M);
  10. + // copied from operator *=
  11. + for (int i=0; i<rows; i++)
  12. + {
  13. + for(int ii=0;ii<rowSizes[i];ii++){m_ppElements[i][ii].Value=T(0);}
  14. + }
  15. }
  16. template<class T>
  17. void SparseMatrix<T>::SetIdentity()
  18. {
  19. SetZero();
  20. - for(int ij=0; ij < Min( this->Rows(), this->Columns() ); ij++)
  21. + for(int ij=0; ij < std::min<int>( rows, _maxEntriesPerRow ); ij++)
  22. (*this)(ij,ij) = T(1);
  23. }
  24. @@ -388,7 +392,7 @@ namespace pcl
  25. T alpha,beta,rDotR;
  26. int i;
  27. - solution.Resize(M.Columns());
  28. + solution.Resize(bb.Dimensions());
  29. solution.SetZero();
  30. d=r=bb;