[ VIGRA Homepage | Class Index | Function Index | File Index | Main Page ]

| PolynomialView Class Template Reference |
--- | --- | ---

`#include "vigra/polynomial.hxx"`

Inheritance diagram for PolynomialView:

## Public Types

typedef T | value_type
typedef NumericTraits< T >::RealPromote | RealPromote
typedef NumericTraits< RealPromote >::ValueType | Real
typedef NumericTraits< RealPromote >::ComplexPromote | Complex
typedef T * | iterator
typedef T const * | const_iterator

## Public Methods

| PolynomialView (T *coeffs, unsigned int order, double epsilon=1.0e-14)
T & | operator[] (unsigned int i)
| Access the coefficient of x^i.
T const & | operator[] (unsigned int i) const
| Access the coefficient of x^i.
template<class V> PromoteTraits< T, V >::Promote | operator() (V v) const
void | differentiate (unsigned int n=1)
void | deflate (T const &r, unsigned int multiplicity=1)
void | forwardDeflate (T const &v)
void | forwardBackwardDeflate (T v)
void | backwardDeflate (T v)
void | deflateConjugatePair (Complex const &v)
void | minimizeOrder (double epsilon=0.0)
void | normalize ()
iterator | begin ()
iterator | end ()
const_iterator | begin () const
const_iterator | end () const
unsigned int | size () const
unsigned int | order () const
double | epsilon () const
void | setEpsilon (double eps)

## Detailed Description

### template<class T>
class vigra::PolynomialView< T >

Polynomial interface for an externally managed array.

The coefficient type `T` can be either a scalar or complex (compatible to `std::complex`) type.

See also:
  vigra::Polynomial, vigra::StaticPolynomial, polynomialRoots()

#include "vigra/polynomial.hxx"
Namespace: vigra

## Member Typedef Documentation

typedef NumericTraits<RealPromote>::ComplexPromote Complex

| Complex type associated with `RealPromote` Reimplemented in Polynomial, and StaticPolynomial.

typedef T const* const_iterator

| Const iterator for the coefficient sequence Reimplemented in Polynomial, and StaticPolynomial.

typedef T* iterator

| Iterator for the coefficient sequence Reimplemented in Polynomial, and StaticPolynomial.

typedef NumericTraits<RealPromote>::ValueType Real

| Scalar type associated with `RealPromote` Reimplemented in Polynomial, and StaticPolynomial.

typedef NumericTraits<T>::RealPromote RealPromote

| Promote type of `value_type` used for polynomial calculations

typedef T value_type

| Coefficient type of the polynomial Reimplemented in Polynomial, and StaticPolynomial.

## Constructor & Destructor Documentation

PolynomialView | ( | T * | coeffs,
|  | unsigned int | order,
|  | double | epsilon = 1.0e-14
| ) | `[inline]`

Construct from a coefficient array of given `order`.

The externally managed array must have length `order+1` and is interpreted as representing the polynomial:

                coeffs[0] + x * coeffs[1] + x * x * coeffs[2] + ...

The coefficients are not copied, we only store a pointer to the array.`epsilon` (default: 1.0e-14) determines the precision of subsequent algorithms (especially root finding) performed on the polynomial.

## Member Function Documentation

void backwardDeflate | ( | T | v | ) |

| Backward-deflate the polynomial at the root `r`. The behavior of this function is undefined if `r` is not a root. Backward deflation is best if `r` is the snallest root (by magnitude).

const_iterator begin | ( |  | ) | const`[inline]`

| Get const_iterator for the coefficient sequence.

iterator begin | ( |  | ) | `[inline]`

| Get iterator for the coefficient sequence.

void deflate | ( | T const & | r,
|  | unsigned int | multiplicity = 1
| ) |

| Deflate the polynomial at the root `r` with the given `multiplicity`. The behavior of this function is undefined if `r` is not a root with at least the given multiplicity. This function calls forwardBackwardDeflate().

void deflateConjugatePair | ( | Complex const & | v | ) |

| Deflate the polynomial with the complex conjugate roots `r` and `conj(r)`. The behavior of this function is undefined if these are not roots.

void differentiate | ( | unsigned int | n = 1 | ) |

| Differentiate the polynomial `n` times.

const_iterator end | ( |  | ) | const`[inline]`

| Get end const_iterator for the coefficient sequence.

iterator end | ( |  | ) | `[inline]`

| Get end iterator for the coefficient sequence.

double epsilon | ( |  | ) | const`[inline]`

| Get requested precision for polynomial algorithms (especially root finding).

void forwardBackwardDeflate | ( | T | v | ) |

| Forward/backward eflate the polynomial at the root `r`. The behavior of this function is undefined if `r` is not a root. Combined forward/backward deflation is best if `r` is an ontermediate root or we don't know `r`'s relation to the other roots of the polynomial.

void forwardDeflate | ( | T const & | v | ) |

| Forward-deflate the polynomial at the root `r`. The behavior of this function is undefined if `r` is not a root. Forward deflation is best if `r` is the biggest root (by magnitude).

void minimizeOrder | ( | double | epsilon = 0.0 | ) |

| Adjust the polynomial's order if the highest coefficients are near zero. The order is reduced as long as the absolute value does not exceed the given epsilon.

void normalize | ( |  | ) |

| Normalize the polynomial, i.e. dived by the highest coefficient.

PromoteTraits< T, U >::Promote operator() | ( | V | v | ) | const

| Evaluate the polynomial at the point `v` Multiplication must be defined between the types `V` and `PromoteTraits<T, V>Promote`. If both `V` and `V` are scalar, the result will be a scalar, otherwise it will be complex.

unsigned int order | ( |  | ) | const`[inline]`

| Get order of the polynomial.

void setEpsilon | ( | double | eps | ) | `[inline]`

| Set requested precision for polynomial algorithms (especially root finding).

unsigned int size | ( |  | ) | const`[inline]`

| Get length of the coefficient sequence (`order() + 1`).

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

- vigra/polynomial.hxx

© Ullrich Köthe (koethe@informatik.uni-hamburg.de) Cognitive Systems Group, University of Hamburg, Germany | html generated using doxygen and Python VIGRA 1.5.0 (7 Dec 2006)