bug #1098: fix regression introduced when generalizing some compute() methods in changeset 7031a851d4

.
This commit is contained in:
Gael Guennebaud 2015-10-26 16:00:25 +01:00
parent af2e25d482
commit f93654ae16
5 changed files with 27 additions and 1 deletions

View File

@ -411,7 +411,7 @@ SelfAdjointEigenSolver<MatrixType>& SelfAdjointEigenSolver<MatrixType>
if(n==1)
{
m_eivalues.coeffRef(0,0) = numext::real(matrix.coeff(0,0));
m_eivalues.coeffRef(0,0) = numext::real(matrix(0,0));
if(computeEigenvectors)
m_eivec.setOnes(n,n);
m_info = Success;

View File

@ -125,6 +125,12 @@ template<typename MatrixType> void eigensolver(const MatrixType& m)
ComplexEigenSolver<MatrixType> eiNaN(a);
VERIFY_IS_EQUAL(eiNaN.info(), NoConvergence);
}
// regression test for bug 1098
{
ComplexEigenSolver<MatrixType> eig(a.adjoint() * a);
eig.compute(a.adjoint() * a);
}
}
template<typename MatrixType> void eigensolver_verify_assert(const MatrixType& m)

View File

@ -39,6 +39,14 @@ template<typename MatrixType> void generalized_eigensolver_real(const MatrixType
VectorType realEigenvalues = eig.eigenvalues().real();
std::sort(realEigenvalues.data(), realEigenvalues.data()+realEigenvalues.size());
VERIFY_IS_APPROX(realEigenvalues, symmEig.eigenvalues());
// regression test for bug 1098
{
GeneralizedSelfAdjointEigenSolver<MatrixType> eig1(a.adjoint() * a,b.adjoint() * b);
eig1.compute(a.adjoint() * a,b.adjoint() * b);
GeneralizedEigenSolver<MatrixType> eig2(a.adjoint() * a,b.adjoint() * b);
eig2.compute(a.adjoint() * a,b.adjoint() * b);
}
}
void test_eigensolver_generalized_real()

View File

@ -70,6 +70,12 @@ template<typename MatrixType> void eigensolver(const MatrixType& m)
EigenSolver<MatrixType> eiNaN(a);
VERIFY_IS_EQUAL(eiNaN.info(), NoConvergence);
}
// regression test for bug 1098
{
EigenSolver<MatrixType> eig(a.adjoint() * a);
eig.compute(a.adjoint() * a);
}
}
template<typename MatrixType> void eigensolver_verify_assert(const MatrixType& m)

View File

@ -156,6 +156,12 @@ template<typename MatrixType> void selfadjointeigensolver(const MatrixType& m)
SelfAdjointEigenSolver<MatrixType> eiSymmNaN(symmC);
VERIFY_IS_EQUAL(eiSymmNaN.info(), NoConvergence);
}
// regression test for bug 1098
{
SelfAdjointEigenSolver<MatrixType> eig(a.adjoint() * a);
eig.compute(a.adjoint() * a);
}
}
void bug_854()