diff options
author | Gael Guennebaud <g.gael@free.fr> | 2013-09-20 23:28:10 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2013-09-20 23:28:10 +0200 |
commit | 00dc45d0f912407366b20e132df76cffbbf22449 (patch) | |
tree | 92dbdc392a4a17cf192efbe74613e96038461889 /Eigen/src/SparseQR | |
parent | 4bb1c48f25d0beb89be1af7445e4d704637a1d89 (diff) |
Reduce explicit zeros when applying SparseQR's matrix Q
Diffstat (limited to 'Eigen/src/SparseQR')
-rw-r--r-- | Eigen/src/SparseQR/SparseQR.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Eigen/src/SparseQR/SparseQR.h b/Eigen/src/SparseQR/SparseQR.h index e9b2a6bec..267c48bc3 100644 --- a/Eigen/src/SparseQR/SparseQR.h +++ b/Eigen/src/SparseQR/SparseQR.h @@ -573,6 +573,7 @@ struct SparseQR_QProduct : ReturnByValue<SparseQR_QProduct<SparseQRType, Derived { Scalar tau = Scalar(0); tau = m_qr.m_Q.col(k).dot(res.col(j)); + if(tau==Scalar(0)) continue; tau = tau * m_qr.m_hcoeffs(k); res.col(j) -= tau * m_qr.m_Q.col(k); } @@ -588,6 +589,7 @@ struct SparseQR_QProduct : ReturnByValue<SparseQR_QProduct<SparseQRType, Derived { Scalar tau = Scalar(0); tau = m_qr.m_Q.col(k).dot(res.col(j)); + if(tau==Scalar(0)) continue; tau = tau * m_qr.m_hcoeffs(k); res.col(j) -= tau * m_qr.m_Q.col(k); } |