aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/SparseQR/SparseQR.h
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2018-07-11 14:01:47 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2018-07-11 14:01:47 +0200
commitf00d08cc0a987fa624209b920608b56638404f13 (patch)
tree883c07284a77c476aa84490a1e74c80e0f18c4ac /Eigen/src/SparseQR/SparseQR.h
parent1625476091c2c4576fe9f2eef91df4d0444dc9e0 (diff)
Optimize extraction of Q in SparseQR by exploiting the structure of the identity matrix.
Diffstat (limited to 'Eigen/src/SparseQR/SparseQR.h')
-rw-r--r--Eigen/src/SparseQR/SparseQR.h3
1 files changed, 2 insertions, 1 deletions
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<SparseQR_QProduct<SparseQRType, Derived
// Compute res = Q * other column by column
for(Index j = 0; j < res.cols(); j++)
{
- for (Index k = diagSize-1; k >=0; k--)
+ Index start_k = internal::is_identity<Derived>::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));