From a6dc930d16be86cffba1f2926dea196abab0fe71 Mon Sep 17 00:00:00 2001 From: Rasmus Munk Larsen Date: Thu, 22 Feb 2024 16:49:10 -0800 Subject: [PATCH] Speed up SparseQR. --- Eigen/src/SparseQR/SparseQR.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Eigen/src/SparseQR/SparseQR.h b/Eigen/src/SparseQR/SparseQR.h index 3e3352fb0..acb0c5ffc 100644 --- a/Eigen/src/SparseQR/SparseQR.h +++ b/Eigen/src/SparseQR/SparseQR.h @@ -481,9 +481,7 @@ void SparseQR::factorize(const MatrixType& mat) { tdot *= m_hcoeffs(curIdx); // Then update tval = tval - q * tau - // FIXME: tval -= tdot * m_Q.col(curIdx) should amount to the same (need to check/add support for efficient "dense - // ?= sparse") - for (typename QRMatrixType::InnerIterator itq(m_Q, curIdx); itq; ++itq) tval(itq.row()) -= itq.value() * tdot; + tval -= tdot * m_Q.col(curIdx); // Detect fill-in for the current column of Q if (m_etree(Ridx(i)) == nonzeroCol) {