mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Fix real schur and polynomial solver.
For certain inputs, the real schur decomposition might get stuck in a cycle. Exceptional shifts are supposed to knock us out of that - but previously they were only ever applied at iteration 10 and 30, which doesn't help if the cycle starts after cycle 30. Modified to apply a shift every 16 iterations (for reference, LAPACK seems to do it every 6 iterations). Also added an assert in polynomial solver to verify that the schur decomposition was successful. Fixes #2633.
This commit is contained in:
@@ -98,6 +98,16 @@ template<typename MatrixType> void schur(int size = MatrixType::ColsAtCompileTim
|
||||
}
|
||||
}
|
||||
|
||||
void test_bug2633() {
|
||||
Eigen::MatrixXd A(4, 4);
|
||||
A << 0, 0, 0, -2,
|
||||
1, 0, 0, -0,
|
||||
0, 1, 0, 2,
|
||||
0, 0, 2, -0;
|
||||
RealSchur<Eigen::MatrixXd> schur(A);
|
||||
VERIFY(schur.info() == Eigen::Success);
|
||||
}
|
||||
|
||||
EIGEN_DECLARE_TEST(schur_real)
|
||||
{
|
||||
CALL_SUBTEST_1(( schur<Matrix4f>() ));
|
||||
@@ -107,4 +117,6 @@ EIGEN_DECLARE_TEST(schur_real)
|
||||
|
||||
// Test problem size constructors
|
||||
CALL_SUBTEST_5(RealSchur<MatrixXf>(10));
|
||||
|
||||
CALL_SUBTEST_6(( test_bug2633() ));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user