Marine systems simulation
CoRiBoDynamics::PolynomialTools::ComplexPolynomial< N > Class Template Reference

Class representing a general polynomial with complex coefficients. More...

#include <PolynomialTools.h>

Public Member Functions

void Evaluate (ComplexDouble x, ComplexDouble &fx, ComplexDouble &dfx, ComplexDouble &ddfx, double &err)
 
void ExtractRoot (ComplexDouble root, ComplexPolynomial< N-1 > &Factor)
 
ComplexDouble LaguerreIteration (const ComplexDouble &FX, const ComplexDouble &DFX, const ComplexDouble &DDFX)
 
int FindRoots (ComplexDouble X0, ComplexDouble *roots)
 
int FindRootsHQ (ComplexDouble X0, ComplexDouble *roots)
 

Public Attributes

ComplexDouble C [N+1]
 

Detailed Description

template<unsigned int N>
class CoRiBoDynamics::PolynomialTools::ComplexPolynomial< N >

The main purpose of the class is polynomial root finding. A fairly robust and accurate numerical root finder (Laguerre's method) is implemented. The method finds all complex and real roots.

Author
Jorgen Haavind Jensen
Revision history:
Q4 2011 JHJ: Initial Version

Member Function Documentation

◆ Evaluate()

template<unsigned int N>
void CoRiBoDynamics::PolynomialTools::ComplexPolynomial< N >::Evaluate ( ComplexDouble  x,
ComplexDouble &  fx,
ComplexDouble &  dfx,
ComplexDouble &  ddfx,
double &  err 
)
inline

Evaluates the polynomial and its first two derivatives in the point 'x' Also makes an estimate of the numerical roundoff error bound

◆ ExtractRoot()

template<unsigned int N>
void CoRiBoDynamics::PolynomialTools::ComplexPolynomial< N >::ExtractRoot ( ComplexDouble  root,
ComplexPolynomial< N-1 > &  Factor 
)
inline

Factors out the given root from the polynomial, and writes the result to 'Factor' The 'root' is assumed to be a true root of the polynomial. If this is not the case, results are undefined.

◆ FindRoots()

template<unsigned int N>
int CoRiBoDynamics::PolynomialTools::ComplexPolynomial< N >::FindRoots ( ComplexDouble  X0,
ComplexDouble *  roots 
)
inline

Finds all complex roots of the polynomial. 'X0' is the suggested starting iteration value.

◆ FindRootsHQ()

template<unsigned int N>
int CoRiBoDynamics::PolynomialTools::ComplexPolynomial< N >::FindRootsHQ ( ComplexDouble  X0,
ComplexDouble *  roots 
)
inline

Finds all complex roots of the polynomial. 'X0' is the suggested starting iteration value. Performs backwards adjustments of roots found by lower order polynomials. Recommended for high order polynomials with very strict accuracy requirements.

◆ LaguerreIteration()

template<unsigned int N>
ComplexDouble CoRiBoDynamics::PolynomialTools::ComplexPolynomial< N >::LaguerreIteration ( const ComplexDouble &  FX,
const ComplexDouble &  DFX,
const ComplexDouble &  DDFX 
)
inline

Computes the step from one iteration of Laguerre's method of polynomial root finding.


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