The Polynomial Templates


Detailed Description

The Polynomial Templates.


Files

file  jenkinstraub.h
file  laguerre.h
file  muller.h
file  Polynomial.h
file  polyzero.h

Modules

 Polynomial evaluation functions
 Polynomial arithmetics functions
 Polynomial roots-solving functions

Classes

class  Polynomial< T >

Functions

template<class T>
getOptimalScale (const Polynomial< T > &p)
template<class T, class U>
scalePoly (Polynomial< T > &p, const Polynomial< U > &q)
template<class T, class U>
void modulus (const Polynomial< T > &p, Polynomial< U > &q)
template<class T>
cauchyLowerBound (const Polynomial< T > &p, const T &upperBound=T(0))
template<class T>
cauchyUpperBound (const Polynomial< T > &p)
template<class T>
zerosGeometricMean (const Polynomial< T > &p)
template<class T>
zerosGeometricMean (const Polynomial< std::complex< T > > &p)


Function Documentation

template<class T>
T cauchyLowerBound const Polynomial< T > &  p,
const T &  upperBound = T(0)
 

returns the Cauchy lower bound for a polynomial.

approximates the Cauchy lower bound for polynomial p.

This function expects the input polynomial to be of the form:

\[p(x)=-|a_0|+|a_1|x+|a_2|x^2+...+|a_n|x^n\]

where $(a_0,a_1,a_2,...,a_n)$ are real or complex coeficients of the polynomial being examined. The Cauchy lower bound is the value of the only positive zero of $p(x)$ . This zero is found using Newton-Raphson method.

The optional parameter upperBound indicates a starting point from where to start looking for this zero. If upperBound is omited, or null, the geometric mean of the zeros will be used as a starting point for the search.

Example:
#include <complex>
#include "polynomial.h"
#include "polyzero.h"

void main() {
    //  this example shows how to compute the Cauchy lower bound
    //  of a polynomial
    Polynomial< std::complex<double> > p;
    Polynomial<double> mp;

    //  initialize polynomial p
    ...

    //  compute Cauchy polynomial
    modulus(p, mp)
    mp[0] = -mp[0];
    
    //  compute Cauchy lower bound of polynomial p
    double c = cauchyLowerBound(mp, 0);

    // do something
    ...
}
Parameters:
[in] p polynomial being evaluated. Template parameter T can be any non-complex IEEE floating-point type.
[in] upperBound starting point to use for the search.
Returns:
The Cauchy lower bound.
See also:
Polynomial
newtonZero()

Definition at line 233 of file polyzero.h.

template<class T>
T cauchyUpperBound const Polynomial< T > &  p  ) 
 

returns the Cauchy upper bound for a polynomial

Returns the Cauchy upper bound for polynomial p.

The Cauchy upper bound $C_u$ is the result of the equation

\[C_u=1+max_n(|a_0|,|a_1|,...,|a_n|)\]

Parameters:
[in] p polynomial being evaluated. template parameter T can be any real or complex IEEE floating-point type.
See also:
Polynomial
cauchyLowerBound()

Definition at line 266 of file polyzero.h.

template<class T>
T getOptimalScale const Polynomial< T > &  p  ) 
 

returns optimal scale for polynomial.

Computes an optimal scale factor for polynomial p. Thus ensuring that evaluating the polynomial will not result in overflow or underflow.

Parameters:
[in] p a polynomial.
See also:
U scalePoly(Polynomial<T>& p, const Polynomial<U>& q);

Definition at line 1253 of file Polynomial.h.

template<class T, class U>
void modulus const Polynomial< T > &  p,
Polynomial< U > &  q
 

computes the modulus of polynomial p.

Computes the modulus of polynomial p, such as for polynomial:

\[p(x)=a_0+a_1{x}+a_2{x^2}+...+a_n{x^n}\]

the resulting polynomial q will be :

\[q(x)=|a_0|+|a_1|{x}+|a_2|{x^2}+...+|a_n|{x^n}\]

Parameters:
[in] p a polynomial.
[out] q the modulus polynomial p.

Definition at line 1315 of file Polynomial.h.

template<class T, class U>
U scalePoly Polynomial< T > &  p,
const Polynomial< U > &  q
 

rescales a polynomial using an optimal scale.

Computes an optimal scale factor for polynomial p. Thus ensuring that evaluating the polynomial will not result in overflow or underflow, then scales the polynomial p.

Parameters:
[in,out] p a polynomial.
[in] q the modulus polynomial of p.
See also:
scalePoly(Polynomial<T>& p, const Polynomial<U>& q)
modulus(const Polynomial<T>& p, Polynomial<U>& q)

Definition at line 1293 of file Polynomial.h.

template<class T>
T zerosGeometricMean const Polynomial< std::complex< T > > &  p  ) 
 

returns the geometric mean for zeros of a polynomial.

See zerosGeometricMean(const Polynomial<T>& p) for more details.

Definition at line 306 of file polyzero.h.

template<class T>
T zerosGeometricMean const Polynomial< T > &  p  ) 
 

returns the geometric mean for zeros of a polynomial.

Returns the geometric mean for zeros of a polynomial.

According to Vieta's theorem, the geometric mean $G$ for the zeros of a polynomial can be simplified to the result of the equation:

\[G_p=\left[\frac{|a_0|}{|a_n|}\right]^{\frac{1}{n}}, p(x)=a_0+a_1{x}+a_2{x^2}+...+a_n{x^n}, a_n\neq 0\]

Parameters:
[in] p polynomial being evaluated. template parameter T can be any real or complex IEEE floating-point type.
See also:
Polynomial
cauchyLowerBound()

Definition at line 293 of file polyzero.h.


Generated on Mon Aug 21 21:00:38 2006 for The Polynomials Templates Library by  doxygen 1.4.5