EvenPolynomialParam.h

Classes

EvenPolynomialParam -- Parameter handling for even polynomials (full description)

template<class T> class EvenPolynomialParam: public Function1D<T>

Interface

Public Members
EvenPolynomialParam()
explicit EvenPolynomialParam(uInt order)
EvenPolynomialParam(const EvenPolynomialParam<T> &other)
template <class W> EvenPolynomialParam(const EvenPolynomialParam<W> &other) : Function1D<T>(other)
EvenPolynomialParam<T> &operator=(const EvenPolynomialParam<T> &other)
~EvenPolynomialParam()
Bool operator==(const EvenPolynomialParam<T> &other) const
Bool operator!=(const EvenPolynomialParam<T> &other) const
virtual const String &name() const
uInt order() const
T coefficient(uInt which) const
const Vector<T> &coefficients() const
void setCoefficient(uInt which, const T value)
void setCoefficients(const Vector<T> &coefficients)

Description

Prerequisite

Etymology

A 1-dimensional EvenPolynomial's parameters.

Synopsis

An EvenPolynomial is described by a set of coefficients; its fundamental operation is evaluating itself at some "x". The number of coefficients is the order of the polynomial divided by two, plus one.

Since the EvenPolynomial is a Function, the derivatives can be obtained as well.

The parameter interface (see FunctionParam class), is used to provide an interface to the Fitting classes.

This class is in general used implicitly by the EvenPolynomial class only.

Example

  EvenPolynomial<Float> pf(3);  // Second order polynomial - coeffs 0 by default
  pf.setCoefficient(0, 1.0);
  pf[1] = 2.0;		// 2x^2 + 1x^0
  pf(2); // == 8

Template Type Argument Requirements (T)

Thrown Exceptions

To Do

Member Description

EvenPolynomialParam()

Constructs a zero'th order polynomial, with a coeficcient of 0.0.

explicit EvenPolynomialParam(uInt order)

Makes a polynomial of the given order, with all coeficcients set to zero.

EvenPolynomialParam(const EvenPolynomialParam<T> &other)
template <class W> EvenPolynomialParam(const EvenPolynomialParam<W> &other) : Function1D<T>(other)
EvenPolynomialParam<T> &operator=(const EvenPolynomialParam<T> &other)

Make this a copy of other (deep copy).

~EvenPolynomialParam()

Destructor

Bool operator==(const EvenPolynomialParam<T> &other) const
Bool operator!=(const EvenPolynomialParam<T> &other) const

Comparisons. EvenPolynomials are equal if they are the same order

virtual const String &name() const

Give name of function

uInt order() const

What is the order of the polynomial, i.e. maximum exponent of "x".

T coefficient(uInt which) const

What is the which'th coefficient of the polynomial. For an nth degree polynomial, which varies between zero and n/2.

const Vector<T> &coefficients() const

Return all the coefficients as a vector.

void setCoefficient(uInt which, const T value)

Set the which'th coefficient to value.

void setCoefficients(const Vector<T> &coefficients)

Set all the coefficients at once, throw away all existing coefficients.