mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-07-23 21:34:30 +08:00
fix QR solving with m>n
This commit is contained in:
parent
c7b8de77c0
commit
b09bb50aeb
@ -270,14 +270,14 @@ bool QR<MatrixType>::solve(
|
|||||||
ei_assert(m_isInitialized && "QR is not initialized.");
|
ei_assert(m_isInitialized && "QR is not initialized.");
|
||||||
const int rows = m_qr.rows();
|
const int rows = m_qr.rows();
|
||||||
ei_assert(b.rows() == rows);
|
ei_assert(b.rows() == rows);
|
||||||
result->resize(rows, b.cols());
|
result->resize(m_qr.cols(), b.cols());
|
||||||
|
|
||||||
// TODO(keir): There is almost certainly a faster way to multiply by
|
// TODO(keir): There is almost certainly a faster way to multiply by
|
||||||
// Q^T without explicitly forming matrixQ(). Investigate.
|
// Q^T without explicitly forming matrixQ(). Investigate.
|
||||||
*result = matrixQ().transpose()*b;
|
*result = matrixQ().transpose()*b;
|
||||||
|
|
||||||
if(m_rank==0)
|
if(m_rank==0)
|
||||||
return result.isZero();
|
return result->isZero();
|
||||||
|
|
||||||
if(!isSurjective())
|
if(!isSurjective())
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user