mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-01-18 14:34:17 +08:00
bug #1098: fix regression introduced when generalizing some compute() methods in changeset 7031a851d4
.
This commit is contained in:
parent
af2e25d482
commit
f93654ae16
@ -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;
|
||||
|
@ -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)
|
||||
|
@ -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()
|
||||
|
@ -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)
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user