Fix real schur and polynomial solver.

This commit is contained in:
Antonio Sánchez
2024-02-17 15:22:11 +00:00
parent 8a4118746e
commit b14c5d0fa1
3 changed files with 33 additions and 22 deletions

View File

@@ -320,6 +320,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