mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-22 17:49:36 +08:00
fix remaining bug in ColPivHouseholderQR, so now all tests pass again
This commit is contained in:
parent
40865fa28c
commit
126a8e6a69
@ -366,7 +366,8 @@ struct ei_solve_retval<ColPivHouseholderQR<_MatrixType>, Rhs>
|
|||||||
.template triangularView<UpperTriangular>()
|
.template triangularView<UpperTriangular>()
|
||||||
.solveInPlace(c.corner(TopLeft, dec().rank(), c.cols()));
|
.solveInPlace(c.corner(TopLeft, dec().rank(), c.cols()));
|
||||||
|
|
||||||
dst = dec().colsPermutation() * c;
|
for(int i = 0; i < dec().rank(); ++i) dst.row(dec().colsPermutation().indices().coeff(i)) = c.row(i);
|
||||||
|
for(int i = dec().rank(); i < cols; ++i) dst.row(dec().colsPermutation().indices().coeff(i)).setZero();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -57,8 +57,6 @@ template<typename MatrixType> void qr()
|
|||||||
MatrixType c = MatrixType::Zero(rows,cols);
|
MatrixType c = MatrixType::Zero(rows,cols);
|
||||||
|
|
||||||
for(int i = 0; i < cols; ++i) c.col(qr.colsPermutation().indices().coeff(i)) = b.col(i);
|
for(int i = 0; i < cols; ++i) c.col(qr.colsPermutation().indices().coeff(i)) = b.col(i);
|
||||||
std::cout << "m1:\n" << m1 << std::endl;
|
|
||||||
std::cout << "c:\n" << c << std::endl;
|
|
||||||
VERIFY_IS_APPROX(m1, c);
|
VERIFY_IS_APPROX(m1, c);
|
||||||
|
|
||||||
MatrixType m2 = MatrixType::Random(cols,cols2);
|
MatrixType m2 = MatrixType::Random(cols,cols2);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user