fix bug #410: fix a possible out of range access in EigenSolver

This commit is contained in:
Gael Guennebaud
2012-01-25 19:02:31 +01:00
parent 362fcabc44
commit a108216af1
2 changed files with 12 additions and 1 deletions

View File

@@ -114,6 +114,17 @@ void test_eigensolver_generic()
// Test problem size constructors
CALL_SUBTEST_5(EigenSolver<MatrixXf>(s));
// regression test for bug 410
CALL_SUBTEST_2(
{
MatrixXd A(1,1);
A(0,0) = std::sqrt(-1.);
Eigen::EigenSolver<MatrixXd> solver(A);
MatrixXd V(1, 1);
V(0,0) = solver.eigenvectors()(0,0).real();
}
);
EIGEN_UNUSED_VARIABLE(s)
}