[ 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 >:

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

## ◆ value_type

template<class T >

typedef T value_type

Coefficient type of the polynomial

## ◆ RealPromote

template<class T >

typedef NumericTraits<T>::RealPromote RealPromote

Promote type of `value_type` used for polynomial calculations

## ◆ Real

template<class T >

typedef NumericTraits<RealPromote>::ValueType Real

Scalar type associated with `RealPromote`

## ◆ Complex

template<class T >

typedef NumericTraits<RealPromote>::ComplexPromote Complex

Complex type associated with `RealPromote`

## ◆ iterator

template<class T >

typedef T* iterator

Iterator for the coefficient sequence

## ◆ const_iterator

template<class T >

typedef T const* const_iterator

Const iterator for the coefficient sequence

## Constructor & Destructor Documentation

## ◆ PolynomialView()

template<class T >

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] + ...
vigra::RGBValue
Class for a single RGB value.
Definition rgbvalue.hxx:128

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

## ◆ operator()()

template<class T >
template<class V >

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.

## ◆ differentiate()

template<class T >

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

Differentiate the polynomial `n` times.

## ◆ deflate()

template<class T >

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

## ◆ forwardDeflate()

template<class T >

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

## ◆ forwardBackwardDeflate()

template<class T >

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.

## ◆ backwardDeflate()

template<class T >

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

## ◆ deflateConjugatePair()

template<class T >

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.

## ◆ minimizeOrder()

template<class T >

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.

## ◆ normalize()

template<class T >

void normalize | ( |  | ) |

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

## ◆ begin() [1/2]

template<class T >

iterator begin | ( |  | ) |

Get iterator for the coefficient sequence.

## ◆ end() [1/2]

template<class T >

iterator end | ( |  | ) |

Get end iterator for the coefficient sequence.

## ◆ begin() [2/2]

template<class T >

const_iterator begin | ( |  | ) | const

Get const_iterator for the coefficient sequence.

## ◆ end() [2/2]

template<class T >

const_iterator end | ( |  | ) | const

Get end const_iterator for the coefficient sequence.

## ◆ size()

template<class T >

unsigned int size | ( |  | ) | const

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

## ◆ order()

template<class T >

unsigned int order | ( |  | ) | const

Get order of the polynomial.

## ◆ epsilon()

template<class T >

double epsilon | ( |  | ) | const

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

## ◆ setEpsilon()

template<class T >

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