Polynomial evaluation functions
[The Polynomial Templates]


Detailed Description

Polynomial evaluation functions.


Functions

template<class T, class U>
eval (const Polynomial< T > &p, const U &x)
template<class T, class U, class V>
eval (const Polynomial< T > &p, const U &x, V &e)
template<class T, class U>
evalAndDeflate (const Polynomial< T > &p, const U &a, Polynomial< U > &q)
template<class T, class U, class V>
evalAndDeflate (const Polynomial< T > &p, const U &a, Polynomial< U > &q, V &e)
template<class T, class U>
evalError (const Polynomial< T > &p, const U &mx)
template<class T, class U>
evalAndDerive (const Polynomial< T > &p, const U &x, U &ppx)
template<class T, class U>
evalAndDerive (const Polynomial< T > &p, const U &x, U &ppx, U &pppx)
template<class T, class U>
evalDeriveAndDeflate (const Polynomial< T > &p, const U &x, U &ppx, U &pppx, Polynomial< U > &q)


Function Documentation

template<class T, class U, class V>
U eval const Polynomial< T > &  p,
const U &  x,
V &  e
 

evaluates polynomial value $y = p(x)$ .

Evaluates $p(x)$ by Horner's recurence. This is the preferred way of evaluating polynomials, since the member function Polynomial<T>::eval() is resricted to same-type polynomial coeficients and variable x

No error checking is performed, so any validation for overflow, or underflow is the responsibility of the caller.

Parameters:
[in] p a polynomial.
[in] x parameter of $p(x)$
[out] e round-off error to be expected in the calculation of $p(x)$
Returns:
The value of $p(x)$ .
See also:
eval(const Polynomial<T>& p, const U& x)\ Polynomial<T>::eval(const T& x) const

Definition at line 896 of file Polynomial.h.

template<class T, class U>
U eval const Polynomial< T > &  p,
const U &  x
 

evaluates polynomial value $y = p(x)$ .

Evaluates $p(x)$ by Horner's recurence. This is the preferred way of evaluating polynomials, since the member function Polynomial<T>::eval() is resricted to same-type polynomial coeficients and variable x

No error checking is performed, so any validation for overflow, or underflow is the responsibility of the caller.

Parameters:
[in] p a polynomial.
[in] x parameter of $p(x)$
Returns:
The value of $p(x)$ .
See also:
Polynomial<T>::eval(const T& x) const
eval(const Polynomial<T>& p, const U& x, V& e)

Definition at line 860 of file Polynomial.h.

template<class T, class U, class V>
U evalAndDeflate const Polynomial< T > &  p,
const U &  a,
Polynomial< U > &  q,
V &  e
 

evaluates polynomial value p(a), and computes $\frac{p(x)}{(x - a)}$ .

Evaluates $p(a)$ and polynomial $q(x)=\frac{p(x)-p(a)}{(x - a)}$ at the same time by Horner's recurence.

It can be shown that $p(x)=q(x)(x - a)+p(a)$ , which essentially means that $p(a)$ is the remainder of $\frac{p(x)}{(x - a)}$ . For the special case where $a$ is a root of $p(x)$ (i.e. $p(a)=0$ ), this operation is called deflation. That is, on exit $q(x)$ will have all the roots of $p(x)$ , except for the root $a$ .

No error checking is performed, so any validation for overflow, or underflow is the responsibility of the caller.

Parameters:
[in] p a polynomial.
[in] a parameter of $p(a)$ .
[out] q on exit contains the quotient $q(x)=\frac{p(x)-p(a)}{(x - a)}$ .
[out] e round-off error to be expected in the calculation of $p(a)$
Returns:
$p(a)$ , the remainder of $\frac{p(x)}{(x - a)}$ .
See also:
Polynomial<T>::evalAndDeflate(const U& x, Polynomial<U>& q) const
Polynomial<T>::evalAndDeflate(const U& x, Polynomial<U>& q, V& e) const
evalAndDeflate(const Polynomial<T>& p, const U& x, Polynomial<U>& q)

Definition at line 1011 of file Polynomial.h.

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

evaluates polynomial value p(a), and computes $\frac{p(x)}{(x - a)}$ .

Evaluates $p(a)$ and polynomial $q(x)=\frac{p(x)-p(a)}{(x - a)}$ at the same time by Horner's recurence.

It can be shown that $p(x)=q(x)(x - a)+p(a)$ , which essentially means that $p(a)$ is the remainder of $\frac{p(x)}{(x - a)}$ . For the special case where $a$ is a root of $p(x)$ (i.e. $p(a)=0$ ), this operation is called deflation. That is, on exit $q(x)$ will have all the roots of $p(x)$ , except for the root $a$ .

No error checking is performed, so any validation for overflow, or underflow is the responsibility of the caller.

Parameters:
[in] p a polynomial.
[in] a parameter of $p(a)$ .
[out] q on exit contains the quotient $q(x)=\frac{p(x)-p(a)}{(x - a)}$ .
Returns:
$p(a)$ , the remainder of $\frac{p(x)}{(x - a)}$ .
See also:
Polynomial<T>::evalAndDeflate(const U& x, Polynomial<U>& q) const
Polynomial<T>::evalAndDeflate(const U& x, Polynomial<U>& q, V& e) const
evalAndDeflate(const Polynomial<T>& p, const U& x, Polynomial<U>& q, V& e)

Definition at line 954 of file Polynomial.h.

template<class T, class U>
U evalAndDerive const Polynomial< T > &  p,
const U &  x,
U &  ppx,
U &  pppx
 

evaluates $p(x)$ , first derivate $p'(x)$ , and second derivative $p''(x)$ at the same time.

Evaluates efficiently $p(x)$ , first derivate $p'(x)$ , and second derivative $p''(x)$ at the same time.

Parameters:
[in] p a polynomial.
[in] x variable to evaluate.
[out] ppx on exit contains $p'(x)$ .
[out] pppx on exit contains $p''(x)$ .
Returns:
The value of $p(x)$ .
See also:
evalAndDerive(const Polynomial<T>& p, const U& x, U& ppx)

Definition at line 1141 of file Polynomial.h.

template<class T, class U>
U evalAndDerive const Polynomial< T > &  p,
const U &  x,
U &  ppx
 

evaluates $p(x)$ and first derivate $dy=p'(x)$ at the same time.

Evaluates efficiently $p(x)$ and first derivative $p'(x)$ at the same time.

Parameters:
[in] p a polynomial.
[in] x variable to evaluate.
[out] ppx on exit contains $p'(x)$ .
Returns:
The value of $p(x)$ .
See also:
evalAndDerive(const Polynomial<T>& p, const U& x, U& ppx, U& pppx)

Definition at line 1095 of file Polynomial.h.

template<class T, class U>
U evalDeriveAndDeflate const Polynomial< T > &  p,
const U &  x,
U &  ppx,
U &  pppx,
Polynomial< U > &  q
 

evaluates first derivate $p'(x)$ , second derivative $p''(x)$ , and deflates a polynomial at the same time.

Evaluates efficiently $p(x)$ , first derivate $p'(x)$ , and second derivative $p''(x)$ , while deflating the polynomial p.

Parameters:
[in] p a polynomial.
[in] x variable to evaluate.
[out] ppx on exit, contains $p'(x)$ .
[out] pppx on exit, contains $p''(x)$ .
[out] q on exit, contains $q(z)=\frac{p(z)}{z-x}$
Returns:
The value of $p(x)$ .
See also:
evalAndDerive(const Polynomial<T>& p, const U& x, U& ppx, U& ppx)

Definition at line 1197 of file Polynomial.h.

template<class T, class U>
U evalError const Polynomial< T > &  p,
const U &  mx
 

evaluates round-off error.

Evaluates round_off error in computing $p(x)$ .

Parameters:
[in] p a polynomial.
[in] mx absolute value of x.
Returns:
e round-off error to be expected in the calculation of $p(x)$
See also:
eval(const Polynomial<T>& p, const U& x, V& e)
evalAndDeflate(const Polynomial<T>& p, const U& x, Polynomial<U>& q, V& e)
Polynomial<T>::evalAndDeflate(const U& x, Polynomial<U>& q, V& e) const

Definition at line 1063 of file Polynomial.h.


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