aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/SparseQR
diff options
context:
space:
mode:
authorGravatar Desire NUENTSA <desire.nuentsa_wakam@inria.fr>2013-05-22 10:44:12 +0200
committerGravatar Desire NUENTSA <desire.nuentsa_wakam@inria.fr>2013-05-22 10:44:12 +0200
commite0566a817f4092ae58b6cd3a3fb8d2abd10357c9 (patch)
tree3b6ded55b9bf9c78a43adaf743bce621efe5cd09 /Eigen/src/SparseQR
parent8e050bd68163a64e0252eed66e215baafb6c11ca (diff)
Delete unneeded resize in SparseQR
Diffstat (limited to 'Eigen/src/SparseQR')
-rw-r--r--Eigen/src/SparseQR/SparseQR.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/Eigen/src/SparseQR/SparseQR.h b/Eigen/src/SparseQR/SparseQR.h
index 0c70609b4..1bf631507 100644
--- a/Eigen/src/SparseQR/SparseQR.h
+++ b/Eigen/src/SparseQR/SparseQR.h
@@ -220,6 +220,7 @@ class SparseQR
protected:
inline void sort_matrix_Q()
{
+ if(this->m_isQSorted) return;
// The matrix Q is sorted during the transposition
SparseMatrix<Scalar, RowMajor, Index> mQrm(this->m_Q);
this->m_Q = mQrm;
@@ -622,17 +623,14 @@ struct SparseQRMatrixQReturnType : public EigenBase<SparseQRMatrixQReturnType<Sp
}
template<typename Dest> void evalTo(MatrixBase<Dest>& dest) const
{
- dest.resize(m_qr.rows(), m_qr.cols());
dest.derived() = m_qr.matrixQ() * Dest::Identity(m_qr.rows(), m_qr.rows());
}
template<typename Dest> void evalTo(SparseMatrixBase<Dest>& dest) const
{
Dest idMat(m_qr.rows(), m_qr.rows());
idMat.setIdentity();
- dest.derived().resize(m_qr.rows(), m_qr.cols());
// Sort the sparse householder reflectors if needed
- if(!m_qr.m_isQSorted)
- const_cast<SparseQRType *>(&m_qr)->sort_matrix_Q();
+ const_cast<SparseQRType *>(&m_qr)->sort_matrix_Q();
dest.derived() = SparseQR_QProduct<SparseQRType, Dest>(m_qr, idMat, false);
}