OddPolynomial.h

Classes

OddPolynomial -- A one dimensional odd polynomial class (full description)
OddPolynomial_PS -- Partial specialization of OddPolynomial for AutoDiff (full description)

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

Interface

Public Members
OddPolynomial() : OddPolynomialParam<T>()
explicit OddPolynomial(uInt order) : order<T>(order)
OddPolynomial(const OddPolynomial<T> &other) : other<T>(other)
template <class W> OddPolynomial(const OddPolynomial<W> &other) : OddPolynomialParam<T>(other)
OddPolynomial<T> &operator=(const OddPolynomial<T> &other)
virtual ~OddPolynomial()
virtual T eval(typename Function1D<T>::FunctionArg x) const
virtual Function<T> *clone() const
virtual Function<typename FunctionTraits<T>::DiffType> *cloneAD() const
virtual Function<typename FunctionTraits<T>::BaseType> *cloneNonAD() const

Description

Prerequisite

Synopsis

A OddPolynomial contains 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, so is the number of available parameters.

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

OddPolynomial() : OddPolynomialParam<T>()

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

explicit OddPolynomial(uInt order) : order<T>(order)

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

OddPolynomial(const OddPolynomial<T> &other) : other<T>(other)
template <class W> OddPolynomial(const OddPolynomial<W> &other) : OddPolynomialParam<T>(other)
OddPolynomial<T> &operator=(const OddPolynomial<T> &other)

Copy constructor/assignment (deep copy)

virtual ~OddPolynomial()

Destructor

virtual T eval(typename Function1D<T>::FunctionArg x) const

Evaluate the polynomial at x.

virtual Function<T> *clone() const
virtual Function<typename FunctionTraits<T>::DiffType> *cloneAD() const
virtual Function<typename FunctionTraits<T>::BaseType> *cloneNonAD() const

Return a copy of this object from the heap. The caller is responsible for deleting the pointer.


template <class T> class OddPolynomial_PS<AutoDiff<T> > : public OddPolynomialParam<AutoDiff<T> >

Interface

OddPolynomial_PS() : OddPolynomialParam<AutoDiff<T> >()
explicit OddPolynomial_PS(uInt order) : order<OddPolynomialParam<T> >(order)
OddPolynomial_PS(const OddPolynomial_PS<AutoDiff<T> > &other) : other<AutoDiff<T> >(other)
template <class W> OddPolynomial_PS(const OddPolynomial_PS<W> &other) : OddPolynomialParam<other<T> >(other)
OddPolynomial_PS<AutoDiff<T> > & operator=(const OddPolynomial_PS<AutoDiff<T> > &other)
virtual ~OddPolynomial_PS()
virtual AutoDiff<T> eval(typename Function<AutoDiff<T> >::FunctionArg x) const
virtual Function<AutoDiff<T> > *clone() const
virtual Function<typename FunctionTraits<Traits<T> >::DiffType> *cloneAD() const
virtual Function<typename FunctionTraits<Traits<T> >::BaseType> *cloneNonAD() const

Description

Synopsis

Warning The name OddPolynomial_PS is only for cxx2html documentation problems. Use OddPolynomial in your code.

Member Description

OddPolynomial_PS() : OddPolynomialParam<AutoDiff<T> >()
explicit OddPolynomial_PS(uInt order) : order<OddPolynomialParam<T> >(order)

Constructs one dimensional OddPolynomials.

OddPolynomial_PS(const OddPolynomial_PS<AutoDiff<T> > &other) : other<AutoDiff<T> >(other)
template <class W> OddPolynomial_PS(const OddPolynomial_PS<W> &other) : OddPolynomialParam<other<T> >(other)

Copy constructor (deep copy)

OddPolynomial_PS<AutoDiff<T> > & operator=(const OddPolynomial_PS<AutoDiff<T> > &other)

Copy assignment (deep copy)

virtual ~OddPolynomial_PS()

Destructor

virtual AutoDiff<T> eval(typename Function<AutoDiff<T> >::FunctionArg x) const

Evaluate the polynomial and its derivatives at x wrt to the coefficients.

virtual Function<AutoDiff<T> > *clone() const
virtual Function<typename FunctionTraits<Traits<T> >::DiffType> *cloneAD() const
virtual Function<typename FunctionTraits<Traits<T> >::BaseType> *cloneNonAD() const

Return a copy of this object from the heap. The caller is responsible for deleting this pointer.