mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
bug #793: fix overflow in EigenSolver and add respective regression unit test
This commit is contained in:
@@ -121,5 +121,18 @@ void test_eigensolver_generic()
|
||||
}
|
||||
);
|
||||
|
||||
// regression test for bug 793
|
||||
#ifdef EIGEN_TEST_PART_2
|
||||
{
|
||||
MatrixXd a(3,3);
|
||||
a << 0, 0, 1,
|
||||
1, 1, 1,
|
||||
1, 1e+200, 1;
|
||||
Eigen::EigenSolver<MatrixXd> eig(a);
|
||||
VERIFY_IS_APPROX(a * eig.pseudoEigenvectors(), eig.pseudoEigenvectors() * eig.pseudoEigenvalueMatrix());
|
||||
VERIFY_IS_APPROX(a * eig.eigenvectors(), eig.eigenvectors() * eig.eigenvalues().asDiagonal());
|
||||
}
|
||||
#endif
|
||||
|
||||
TEST_SET_BUT_UNUSED_VARIABLE(s)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user