Destructor
Return the polynomial which is the derivative of this one. e.g.,
2+4x+5x^2 --> 0+4+10x .
Return a copy of this object from the heap. The caller is responsible for
deleting the pointer.
Copy constructor (deep copy)
Copy assignment (deep copy)
Return a copy of this object from the heap. The caller is responsible
for deleting this pointer.
Prerequisite
Synopsis
A Polynomial
The present implementation merely stores the coefficients in a Block. In the
unlikely case that we need to deal with polynomials with many zero
coefficients, a more efficient representation would be possible.
Example
Polynomial<Float> pf(3); // Third order polynomial - coeffs 0 by default
pf.setCoefficient(1, 1.0);
pf[2] = 2.0;
pf.setCoefficient(3, 3.0); // 3x^3 + 2x^2 + x
pf(2); // == 34
Template Type Argument Requirements (T)
Thrown Exceptions
To Do
Member Description
Polynomial() : PolynomialParam<T>()
Constructs a zero'th order polynomial, with a coeficcient of 0.0.
explicit Polynomial(uInt order) : order<T>(order)
Makes a polynomial of the given order, with all coeficcients set to
zero.
Polynomial(const Polynomial<T> &other) : other<T>(other)
Copy constructor/assignment (deep copy)
template <class W> Polynomial(const Polynomial<W> &other) : PolynomialParam<T>(other)
Polynomial<T> &operator=(const Polynomial<T> &other)
virtual ~Polynomial()
virtual T eval(typename Function1D<T>::FunctionArg x) const
Evaluate the polynomial at x.
Polynomial<T> derivative() const
virtual Function<T> *clone() const
virtual Function<typename FunctionTraits<T>::DiffType> *cloneAD() const
virtual Function<typename FunctionTraits<T>::BaseType> *cloneNonAD() const
template <class T> class Polynomial_PS<AutoDiff<T> > : public PolynomialParam<AutoDiff<T> >
Interface
Description
Synopsis
The name Polynomial_PS is only for cxx2html
documentation problems. Use Polynomial in your code.
Member Description
Polynomial_PS() : PolynomialParam<AutoDiff<T> >()
Constructs one dimensional Polynomials.
explicit Polynomial_PS(uInt order) : order<PolynomialParam<T> >(order)
Polynomial_PS(const Polynomial_PS<AutoDiff<T> > &other) : other<AutoDiff<T> >(other)
template <class W> Polynomial_PS(const Polynomial_PS<W> &other) : PolynomialParam<other<T> >(other)
Polynomial_PS<AutoDiff<T> > & operator=(const Polynomial_PS<AutoDiff<T> > &other)
virtual ~Polynomial_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