A polynomial solver. More...
Public Types | |
typedef Matrix< Scalar, _Deg, _Deg > | CompanionMatrixType |
typedef EigenSolver < CompanionMatrixType > | EigenSolverType |
typedef PolynomialSolverBase < _Scalar, _Deg > | PS_Base |
Public Member Functions | |
template<typename OtherPolynomial > | |
void | compute (const OtherPolynomial &poly) |
template<typename OtherPolynomial > | |
PolynomialSolver (const OtherPolynomial &poly) | |
Protected Attributes | |
EigenSolverType | m_eigenSolver |
A polynomial solver.
Computes the complex roots of a real polynomial.
_Scalar | the scalar type, i.e., the type of the polynomial coefficients |
_Deg | the degree of the polynomial, can be a compile time value or Dynamic. Notice that the number of polynomial coefficients is _Deg+1. |
This class implements a polynomial solver and provides convenient methods such as
WARNING: this polynomial solver is experimental, part of the unsuported Eigen modules.
Currently a QR algorithm is used to compute the eigenvalues of the companion matrix of the polynomial to compute its roots. This supposes that the complex moduli of the roots are all distinct: e.g. there should be no multiple roots or conjugate roots for instance. With 32bit (float) floating types this problem shows up frequently. However, almost always, correct accuracy is reached even in these cases for 64bit (double) floating types and small polynomial degree (<20).
void compute | ( | const OtherPolynomial & | poly | ) | [inline] |
Computes the complex roots of a new polynomial.