casacore::Polynomial< T > Class Template Reference

A one dimensional polynomial class. More...

#include <Polynomial.h>

Inheritance diagram for casacore::Polynomial< T >:
casacore::PolynomialParam< T > casacore::Function1D< T > casacore::Function< T, U > casacore::Functional< FunctionTraits< T >::ArgType, U > casacore::Functional< Vector< FunctionTraits< T >::ArgType >, U >

List of all members.

Public Member Functions

 Polynomial ()
 Constructs a zero'th order polynomial, with a coeficcient of 0.0.
 Polynomial (uInt order)
 Makes a polynomial of the given order, with all coeficcients set to zero.
 Polynomial (const Polynomial< T > &other)
 Copy constructor/assignment (deep copy).
template<class W >
 Polynomial (const Polynomial< W > &other)
Polynomial< T > & operator= (const Polynomial< T > &other)
virtual ~Polynomial ()
 Destructor.
virtual T eval (typename Function1D< T >::FunctionArg x) const
 Evaluate the polynomial at x.
Polynomial< T > derivative () const
 Return the polynomial which is the derivative of this one.
virtual Function< T > * clone () const
 Return a copy of this object from the heap.
virtual Function< typename
FunctionTraits< T >::DiffType > * 
cloneAD () const
virtual Function< typename
FunctionTraits< T >::BaseType > * 
cloneNonAD () const

Detailed Description

template<class T>
class casacore::Polynomial< T >

A one dimensional polynomial class.

Review Status

Reviewed By:
tcornwel
Date Reviewed:
1996/02/22
Test programs:
tPolynomial

Prerequisite

Synopsis

A Polynomial<T> contains a set of coefficients; its fundamental operations is evaluating itself at some "x". The number of coefficients is the order of the polynomial plus one, so is the number of available parameters.


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

Definition at line 90 of file Polynomial.h.


Constructor & Destructor Documentation

template<class T>
casacore::Polynomial< T >::Polynomial (  )  [inline]

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

Definition at line 96 of file Polynomial.h.

template<class T>
casacore::Polynomial< T >::Polynomial ( uInt  order  )  [inline, explicit]

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

Definition at line 99 of file Polynomial.h.

template<class T>
casacore::Polynomial< T >::Polynomial ( const Polynomial< T > &  other  )  [inline]

Copy constructor/assignment (deep copy).

Definition at line 102 of file Polynomial.h.

template<class T>
template<class W >
casacore::Polynomial< T >::Polynomial ( const Polynomial< W > &  other  )  [inline]

Definition at line 104 of file Polynomial.h.

template<class T>
virtual casacore::Polynomial< T >::~Polynomial (  )  [inline, virtual]

Destructor.

Definition at line 110 of file Polynomial.h.


Member Function Documentation

template<class T>
virtual Function<T>* casacore::Polynomial< T >::clone (  )  const [inline, virtual]

Return a copy of this object from the heap.

The caller is responsible for deleting the pointer.

Implements casacore::Function< T, U >.

Definition at line 124 of file Polynomial.h.

template<class T>
virtual Function<typename FunctionTraits<T>::DiffType>* casacore::Polynomial< T >::cloneAD (  )  const [inline, virtual]

Reimplemented from casacore::Function< T, U >.

Definition at line 125 of file Polynomial.h.

template<class T>
virtual Function<typename FunctionTraits<T>::BaseType>* casacore::Polynomial< T >::cloneNonAD (  )  const [inline, virtual]

Reimplemented from casacore::Function< T, U >.

Definition at line 127 of file Polynomial.h.

template<class T>
Polynomial<T> casacore::Polynomial< T >::derivative (  )  const

Return the polynomial which is the derivative of this one.

e.g., 2+4x+5x^2 --> 0+4+10x .

template<class T>
virtual T casacore::Polynomial< T >::eval ( typename Function1D< T >::FunctionArg  x  )  const [virtual]

Evaluate the polynomial at x.

template<class T>
Polynomial<T>& casacore::Polynomial< T >::operator= ( const Polynomial< T > &  other  )  [inline]

Reimplemented from casacore::PolynomialParam< T >.

Definition at line 105 of file Polynomial.h.

Referenced by casacore::Polynomial< Double >::operator=().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1