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();