fix use of rank in QR

This commit is contained in:
Gael Guennebaud 2010-07-15 19:59:21 +02:00
parent b09bb50aeb
commit ccc6731f86

View File

@ -270,12 +270,15 @@ bool QR<MatrixType>::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();