OddPolynomialParam.h

Classes

OddPolynomialParam -- Parameter handling for odd polynomials (full description)

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

Interface

Public Members
OddPolynomialParam()
explicit OddPolynomialParam(uInt order)
OddPolynomialParam(const OddPolynomialParam<T> &other)
OddPolynomialParam<T> &operator=(const OddPolynomialParam<T> &other)
~OddPolynomialParam()
Bool operator==(const OddPolynomialParam<T> &other) const
Bool operator!=(const OddPolynomialParam<T> &other) 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 OddPolynomial's parameters.

Synopsis

An OddPolynomial 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 OddPolynomial 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 OddPolynomial class only.

Example

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

Template Type Argument Requirements (T)

Thrown Exceptions

To Do

Member Description

OddPolynomialParam()

Constructs a first order polynomial, with a coeficcient of 0.0.

explicit OddPolynomialParam(uInt order)

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

OddPolynomialParam(const OddPolynomialParam<T> &other)
OddPolynomialParam<T> &operator=(const OddPolynomialParam<T> &other)

Make this a copy of other (deep copy).

~OddPolynomialParam()

Destructor

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

Comparisons. OddPolynomials are equal if they are the same order

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.