$treeview $search $mathjax
$projectbrief
$projectbrief
$searchbox

PolynomialSolver< _Scalar, _Deg > Class Template Reference
[Polynomials module]

A polynomial solver. More...

Inheritance diagram for PolynomialSolver< _Scalar, _Deg >:

List of all members.

Public Member Functions

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
template<typename OtherPolynomial >
void compute (const OtherPolynomial &poly)
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 RootsType & roots () const
const RealScalar & smallestRealRoot (bool &hasArealRoot, const RealScalar &absImaginaryThreshold=NumTraits< Scalar >::dummy_precision()) const
const RootType & smallestRoot () 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:
_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).


Member Function Documentation

const RealScalar& absGreatestRealRoot ( bool &  hasArealRoot,
const RealScalar &  absImaginaryThreshold = NumTraits<Scalar>::dummy_precision() 
) const [inline, inherited]
Returns:
a real root with greatest absolute magnitude. A real root is defined as the real part of a complex root with absolute imaginary part smallest than absImaginaryThreshold. absImaginaryThreshold takes the dummy_precision associated with the _Scalar template parameter of the PolynomialSolver class as the default value. If no real root is found the boolean hasArealRoot is set to false and the real part of the root with smallest absolute imaginary part is returned instead.
Parameters:
[out] hasArealRoot : boolean true if a real root is found according to the absImaginaryThreshold criterion, false otherwise.
[in] absImaginaryThreshold : threshold on the absolute imaginary part to decide whether or not a root is real.
const RealScalar& absSmallestRealRoot ( bool &  hasArealRoot,
const RealScalar &  absImaginaryThreshold = NumTraits<Scalar>::dummy_precision() 
) const [inline, inherited]
Returns:
a real root with smallest absolute magnitude. A real root is defined as the real part of a complex root with absolute imaginary part smallest than absImaginaryThreshold. absImaginaryThreshold takes the dummy_precision associated with the _Scalar template parameter of the PolynomialSolver class as the default value. If no real root is found the boolean hasArealRoot is set to false and the real part of the root with smallest absolute imaginary part is returned instead.
Parameters:
[out] hasArealRoot : boolean true if a real root is found according to the absImaginaryThreshold criterion, false otherwise.
[in] absImaginaryThreshold : threshold on the absolute imaginary part to decide whether or not a root is real.
void compute ( const OtherPolynomial &  poly  )  [inline]

Computes the complex roots of a new polynomial.

const RealScalar& greatestRealRoot ( bool &  hasArealRoot,
const RealScalar &  absImaginaryThreshold = NumTraits<Scalar>::dummy_precision() 
) const [inline, inherited]
Returns:
the real root with greatest value. A real root is defined as the real part of a complex root with absolute imaginary part smallest than absImaginaryThreshold. absImaginaryThreshold takes the dummy_precision associated with the _Scalar template parameter of the PolynomialSolver class as the default value. If no real root is found the boolean hasArealRoot is set to false and the real part of the root with smallest absolute imaginary part is returned instead.
Parameters:
[out] hasArealRoot : boolean true if a real root is found according to the absImaginaryThreshold criterion, false otherwise.
[in] absImaginaryThreshold : threshold on the absolute imaginary part to decide whether or not a root is real.
const RootType& greatestRoot (  )  const [inline, inherited]
Returns:
the complex root with greatest norm.
void realRoots ( Stl_back_insertion_sequence &  bi_seq,
const RealScalar &  absImaginaryThreshold = NumTraits<Scalar>::dummy_precision() 
) const [inline, inherited]

Clear and fills the back insertion sequence with the real roots of the polynomial i.e. the real part of the complex roots that have an imaginary part which absolute value is smaller than absImaginaryThreshold. absImaginaryThreshold takes the dummy_precision associated with the _Scalar template parameter of the PolynomialSolver class as the default value.

Parameters:
[out] bi_seq : the back insertion sequence (stl concept)
[in] absImaginaryThreshold : the maximum bound of the imaginary part of a complex number that is considered as real.
const RootsType& roots (  )  const [inline, inherited]
Returns:
the complex roots of the polynomial
const RealScalar& smallestRealRoot ( bool &  hasArealRoot,
const RealScalar &  absImaginaryThreshold = NumTraits<Scalar>::dummy_precision() 
) const [inline, inherited]
Returns:
the real root with smallest value. A real root is defined as the real part of a complex root with absolute imaginary part smallest than absImaginaryThreshold. absImaginaryThreshold takes the dummy_precision associated with the _Scalar template parameter of the PolynomialSolver class as the default value. If no real root is found the boolean hasArealRoot is set to false and the real part of the root with smallest absolute imaginary part is returned instead.
Parameters:
[out] hasArealRoot : boolean true if a real root is found according to the absImaginaryThreshold criterion, false otherwise.
[in] absImaginaryThreshold : threshold on the absolute imaginary part to decide whether or not a root is real.
const RootType& smallestRoot (  )  const [inline, inherited]
Returns:
the complex root with smallest norm.

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