TR-mbed 1.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Attributes | List of all members
Eigen::PolynomialSolver< _Scalar, _Deg > Class Template Reference

A polynomial solver. More...

#include <PolynomialSolver.h>

Inheritance diagram for Eigen::PolynomialSolver< _Scalar, _Deg >:
Eigen::PolynomialSolverBase< _Scalar, _Deg >

Public Types

typedef PolynomialSolverBase< _Scalar, _Deg > PS_Base
 
typedef Matrix< Scalar, _Deg, _Deg > CompanionMatrixType
 
typedef internal::conditional< NumTraits< Scalar >::IsComplex, ComplexEigenSolver< CompanionMatrixType >, EigenSolver< CompanionMatrixType > >::type EigenSolverType
 
typedef internal::conditional< NumTraits< Scalar >::IsComplex, Scalar, std::complex< Scalar > >::type ComplexScalar
 
- Public Types inherited from Eigen::PolynomialSolverBase< _Scalar, _Deg >
typedef _Scalar Scalar
 
typedef NumTraits< Scalar >::Real RealScalar
 
typedef std::complex< RealScalarRootType
 
typedef Matrix< RootType, _Deg, 1 > RootsType
 
typedef DenseIndex Index
 

Public Member Functions

template<typename OtherPolynomial >
void compute (const OtherPolynomial &poly)
 
template<typename OtherPolynomial >
 PolynomialSolver (const OtherPolynomial &poly)
 
 PolynomialSolver ()
 
- Public Member Functions inherited from Eigen::PolynomialSolverBase< _Scalar, _Deg >
template<typename OtherPolynomial >
 PolynomialSolverBase (const OtherPolynomial &poly)
 
 PolynomialSolverBase ()
 
const RootsTyperoots () const
 
template<typename Stl_back_insertion_sequence >
void realRoots (Stl_back_insertion_sequence &bi_seq, const RealScalar &absImaginaryThreshold=NumTraits< Scalar >::dummy_precision()) const
 
const RootTypegreatestRoot () const
 
const RootTypesmallestRoot () const
 
const RealScalarabsGreatestRealRoot (bool &hasArealRoot, const RealScalar &absImaginaryThreshold=NumTraits< Scalar >::dummy_precision()) const
 
const RealScalarabsSmallestRealRoot (bool &hasArealRoot, const RealScalar &absImaginaryThreshold=NumTraits< Scalar >::dummy_precision()) const
 
const RealScalargreatestRealRoot (bool &hasArealRoot, const RealScalar &absImaginaryThreshold=NumTraits< Scalar >::dummy_precision()) const
 
const RealScalarsmallestRealRoot (bool &hasArealRoot, const RealScalar &absImaginaryThreshold=NumTraits< Scalar >::dummy_precision()) const
 

Protected Attributes

EigenSolverType m_eigenSolver
 
RootsType m_roots
 
- Protected Attributes inherited from Eigen::PolynomialSolverBase< _Scalar, _Deg >
RootsType m_roots
 

Additional Inherited Members

- Protected Member Functions inherited from Eigen::PolynomialSolverBase< _Scalar, _Deg >
template<typename OtherPolynomial >
void setPolynomial (const OtherPolynomial &poly)
 
template<typename squaredNormBinaryPredicate >
const RootTypeselectComplexRoot_withRespectToNorm (squaredNormBinaryPredicate &pred) const
 
template<typename squaredRealPartBinaryPredicate >
const RealScalarselectRealRoot_withRespectToAbsRealPart (squaredRealPartBinaryPredicate &pred, bool &hasArealRoot, const RealScalar &absImaginaryThreshold=NumTraits< Scalar >::dummy_precision()) const
 
template<typename RealPartBinaryPredicate >
const RealScalarselectRealRoot_withRespectToRealPart (RealPartBinaryPredicate &pred, bool &hasArealRoot, const RealScalar &absImaginaryThreshold=NumTraits< Scalar >::dummy_precision()) const
 

Detailed Description

template<typename _Scalar, int _Deg>
class Eigen::PolynomialSolver< _Scalar, _Deg >

A polynomial solver.

Computes the complex roots of a real polynomial.

Parameters
_Scalarthe scalar type, i.e., the type of the polynomial coefficients
_Degthe 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 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).

Member Typedef Documentation

◆ CompanionMatrixType

template<typename _Scalar , int _Deg>
typedef Matrix<Scalar,_Deg,_Deg> Eigen::PolynomialSolver< _Scalar, _Deg >::CompanionMatrixType

◆ ComplexScalar

template<typename _Scalar , int _Deg>
typedef internal::conditional<NumTraits<Scalar>::IsComplex,Scalar,std::complex<Scalar>>::type Eigen::PolynomialSolver< _Scalar, _Deg >::ComplexScalar

◆ EigenSolverType

template<typename _Scalar , int _Deg>
typedef internal::conditional<NumTraits<Scalar>::IsComplex,ComplexEigenSolver<CompanionMatrixType>,EigenSolver<CompanionMatrixType>>::type Eigen::PolynomialSolver< _Scalar, _Deg >::EigenSolverType

◆ PS_Base

template<typename _Scalar , int _Deg>
typedef PolynomialSolverBase<_Scalar,_Deg> Eigen::PolynomialSolver< _Scalar, _Deg >::PS_Base

Constructor & Destructor Documentation

◆ PolynomialSolver() [1/2]

template<typename _Scalar , int _Deg>
template<typename OtherPolynomial >
Eigen::PolynomialSolver< _Scalar, _Deg >::PolynomialSolver ( const OtherPolynomial &  poly)
inline

◆ PolynomialSolver() [2/2]

template<typename _Scalar , int _Deg>
Eigen::PolynomialSolver< _Scalar, _Deg >::PolynomialSolver ( )
inline

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.

Member Data Documentation

◆ m_eigenSolver

template<typename _Scalar , int _Deg>
EigenSolverType Eigen::PolynomialSolver< _Scalar, _Deg >::m_eigenSolver
protected

◆ m_roots

template<typename _Scalar , int _Deg>
RootsType Eigen::PolynomialSolverBase< _Scalar, _Deg >::m_roots
protected

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