From ccc6731f86c8b94998fb932a16058a1ad414e2b1 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Thu, 15 Jul 2010 19:59:21 +0200 Subject: [PATCH] fix use of rank in QR --- Eigen/src/QR/QR.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Eigen/src/QR/QR.h b/Eigen/src/QR/QR.h index b8161733a..66e263e33 100644 --- a/Eigen/src/QR/QR.h +++ b/Eigen/src/QR/QR.h @@ -270,12 +270,15 @@ bool QR::solve( ei_assert(m_isInitialized && "QR is not initialized."); const int rows = m_qr.rows(); ei_assert(b.rows() == rows); + // enforce the computation of the rank + rank(); + result->resize(m_qr.cols(), b.cols()); // TODO(keir): There is almost certainly a faster way to multiply by // Q^T without explicitly forming matrixQ(). Investigate. *result = matrixQ().transpose()*b; - + if(m_rank==0) return result->isZero();