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:
@@ -354,6 +354,7 @@ class PolynomialSolver : public PolynomialSolverBase<_Scalar,_Deg>
|
||||
internal::companion<Scalar,_Deg> companion( poly );
|
||||
companion.balance();
|
||||
m_eigenSolver.compute( companion.denseMatrix() );
|
||||
eigen_assert(m_eigenSolver.info() == Eigen::Success);
|
||||
m_roots = m_eigenSolver.eigenvalues();
|
||||
// cleanup noise in imaginary part of real roots:
|
||||
// if the imaginary part is rather small compared to the real part
|
||||
|
||||
Reference in New Issue
Block a user