Eigen-unsupported  3.4.90 (git rev 67eeba6e720c5745abc77ae6c92ce0a44aa7b7ae)
Eigen::PolynomialSolver< Scalar_, Deg_ > Class Template Reference

Detailed Description

template<typename Scalar_, int Deg_>
class Eigen::PolynomialSolver< Scalar_, Deg_ >

A polynomial solver.

Computes the complex roots of a real polynomial.

Parameters
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

  • real roots,
  • greatest, smallest complex roots,
  • real roots with greatest, smallest absolute real value.
  • greatest, smallest real roots.

WARNING: this polynomial solver is experimental, part of the unsupported 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).

+ Inheritance diagram for Eigen::PolynomialSolver< Scalar_, Deg_ >:

Public Member Functions

template<typename OtherPolynomial >
void compute (const OtherPolynomial &poly)
 
- Public Member Functions inherited from Eigen::PolynomialSolverBase< Scalar_, Deg_ >
const RealScalar & absGreatestRealRoot (bool &hasArealRoot, const RealScalar &absImaginaryThreshold=NumTraits< Scalar >::dummy_precision()) const
 
const RealScalar & absSmallestRealRoot (bool &hasArealRoot, const RealScalar &absImaginaryThreshold=NumTraits< Scalar >::dummy_precision()) const
 
const RealScalar & greatestRealRoot (bool &hasArealRoot, const RealScalar &absImaginaryThreshold=NumTraits< Scalar >::dummy_precision()) const
 
const RootType & greatestRoot () const
 
template<typename Stl_back_insertion_sequence >
void realRoots (Stl_back_insertion_sequence &bi_seq, const RealScalar &absImaginaryThreshold=NumTraits< Scalar >::dummy_precision()) const
 
const RootsTyperoots () const
 
const RealScalar & smallestRealRoot (bool &hasArealRoot, const RealScalar &absImaginaryThreshold=NumTraits< Scalar >::dummy_precision()) const
 
const RootType & smallestRoot () const
 

Member Function Documentation

◆ compute()

template<typename Scalar_ , int Deg_>
template<typename OtherPolynomial >
void Eigen::PolynomialSolver< Scalar_, Deg_ >::compute ( const OtherPolynomial &  poly)
inline

Computes the complex roots of a new polynomial.


The documentation for this class was generated from the following file: