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

| PolynomialView< T > Class Template Reference Polynomials and root determination |

`#include <vigra/polynomial.hxx>`

Inheritance diagram for PolynomialView< T >:

List of all members.

## Public Types

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

## Public Member Functions

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

## 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 T value_type

Coefficient type of the polynomial

Reimplemented in StaticPolynomial< MAXORDER, T >, and Polynomial< T >.

typedef NumericTraits<T>::RealPromote RealPromote

Promote type of `value_type` used for polynomial calculations

typedef NumericTraits<RealPromote>::ValueType Real

Scalar type associated with `RealPromote`

Reimplemented in StaticPolynomial< MAXORDER, T >, and Polynomial< T >.

typedef NumericTraits<RealPromote>::ComplexPromote Complex

Complex type associated with `RealPromote`

Reimplemented in StaticPolynomial< MAXORDER, T >, and Polynomial< T >.

typedef T* iterator

Iterator for the coefficient sequence

Reimplemented in StaticPolynomial< MAXORDER, T >, and Polynomial< T >.

typedef T const* const_iterator

Const iterator for the coefficient sequence

Reimplemented in StaticPolynomial< MAXORDER, T >, and Polynomial< T >.

## Constructor & Destructor Documentation

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

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

PromoteTraits<T, V>::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.

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

Differentiate the polynomial `n` times.

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 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 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 intermediate root or we don't know `r`'s relation to the other roots of the polynomial.

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 smallest root (by magnitude).

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 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.

iterator begin | ( |  | ) |

Get iterator for the coefficient sequence.

iterator end | ( |  | ) |

Get end iterator for the coefficient sequence.

const_iterator begin | ( |  | ) | const

Get const_iterator for the coefficient sequence.

const_iterator end | ( |  | ) | const

Get end const_iterator for the coefficient sequence.

unsigned int size | ( |  | ) | const

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

unsigned int order | ( |  | ) | const

Get order of the polynomial.

double epsilon | ( |  | ) | const

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

void setEpsilon | ( | double | eps | ) |

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

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

- vigra/polynomial.hxx

© Ullrich Köthe (ullrich.koethe@iwr.uni-heidelberg.de) Heidelberg Collaboratory for Image Processing, University of Heidelberg, Germany | html generated using doxygen and Python vigra 1.9.0 (Tue Nov 6 2012)