From f00d08cc0a987fa624209b920608b56638404f13 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Wed, 11 Jul 2018 14:01:47 +0200 Subject: [PATCH] Optimize extraction of Q in SparseQR by exploiting the structure of the identity matrix. --- Eigen/src/SparseQR/SparseQR.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Eigen/src/SparseQR/SparseQR.h b/Eigen/src/SparseQR/SparseQR.h index 7409fcae9..1a28389e8 100644 --- a/Eigen/src/SparseQR/SparseQR.h +++ b/Eigen/src/SparseQR/SparseQR.h @@ -640,7 +640,8 @@ struct SparseQR_QProduct : ReturnByValue=0; k--) + Index start_k = internal::is_identity::value ? numext::mini(j,diagSize-1) : diagSize-1; + for (Index k = start_k; k >=0; k--) { Scalar tau = Scalar(0); tau = m_qr.m_Q.col(k).dot(res.col(j));