0001-Avoid-calling-virtual-function-from-DenseMatrix-resi.patch 867 B

12345678910111213141516171819202122232425262728293031
  1. From b75592607138ed3f9891f2769544ddf2b0eb9848 Mon Sep 17 00:00:00 2001
  2. From: John Peterson <jwpeterson@gmail.com>
  3. Date: Fri, 18 Jun 2021 16:09:04 -0500
  4. Subject: [PATCH] Avoid calling virtual function from DenseMatrix::resize()
  5. ---
  6. include/numerics/dense_matrix.h | 7 +++++--
  7. 1 file changed, 5 insertions(+), 2 deletions(-)
  8. diff --git a/include/numerics/dense_matrix.h b/include/numerics/dense_matrix.h
  9. index 277127628..0c58a5d56 100644
  10. --- a/include/numerics/dense_matrix.h
  11. +++ b/include/numerics/dense_matrix.h
  12. @@ -896,8 +896,11 @@ void DenseMatrix<T>::resize(const unsigned int new_m,
  13. this->_m = new_m;
  14. this->_n = new_n;
  15. - // zero and set decomposition_type to NONE
  16. - this->zero();
  17. + // avoid calling virtual function
  18. + // this->zero();
  19. +
  20. + _decomposition_type = NONE;
  21. + std::fill (_val.begin(), _val.end(), static_cast<T>(0));
  22. }
  23. --
  24. 2.17.1