casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions
casa::SPolynomialParam< T > Class Template Reference

Parameter handling for scaled 1-D polynomials. More...

#include <SPolynomialParam.h>

Inheritance diagram for casa::SPolynomialParam< T >:
casa::Function< T > casa::Functional< FunctionTraits< T >::ArgType, T > casa::Functional< Vector< FunctionTraits< T >::ArgType >, T > casa::SPolynomial< T >

List of all members.

Public Member Functions

 SPolynomialParam ()
 Constructs a zero'th order polynomial, with a coeficcient of 0.0.
 SPolynomialParam (uInt order)
 Makes a polynomial of the given order, with all coeficcients set to zero.
 SPolynomialParam (const SPolynomialParam< T > &other)
 Make this a copy of other (deep copy).
template<class W >
 SPolynomialParam (const SPolynomialParam< W > &other)
SPolynomialParam< T > & operator= (const SPolynomialParam< T > &other)
 ~SPolynomialParam ()
 Destructor.
Bool operator== (const SPolynomialParam< T > &other) const
 Comparisons.
Bool operator!= (const SPolynomialParam< T > &other) const
virtual const Stringname () const
 Give name of function.
uInt order () const
 What is the order of the polynomial, i.e.
coefficient (uInt which) const
 What is the which'th coefficient of the polynomial.
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.
virtual uInt ndim () const
 Returns the dimension of function.

Detailed Description

template<class T>
class casa::SPolynomialParam< T >

Parameter handling for scaled 1-D polynomials.

Review Status

Test programs:
tSPolynomial

Prerequisite

Etymology

A 1-dimensional Scaled Polynomial's parameters.

Synopsis

A SPolynomial 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 plus one, plus three, describing a height, center and width. These three parameters are the first three, and have default values of 1, 0, 1.

Since the SPolynomial 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 SPolynomial class only.

Example

     SPolynomial<Float> pf(3);  // Third order polynomial - coeffs 0 by default
     pf.setCoefficient(1, 1.0);
     pf[5] = 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 101 of file SPolynomialParam.h.


Constructor & Destructor Documentation

template<class T>
casa::SPolynomialParam< T >::SPolynomialParam ( )

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

template<class T>
casa::SPolynomialParam< T >::SPolynomialParam ( uInt  order) [explicit]

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

template<class T>
casa::SPolynomialParam< T >::SPolynomialParam ( const SPolynomialParam< T > &  other)

Make this a copy of other (deep copy).

template<class T>
template<class W >
casa::SPolynomialParam< T >::SPolynomialParam ( const SPolynomialParam< W > &  other) [inline]

Definition at line 116 of file SPolynomialParam.h.

template<class T>
casa::SPolynomialParam< T >::~SPolynomialParam ( )

Destructor.


Member Function Documentation

template<class T>
T casa::SPolynomialParam< T >::coefficient ( uInt  which) const [inline]

What is the which'th coefficient of the polynomial.

For an nth degree polynomial, which varies between zero and n.

Definition at line 144 of file SPolynomialParam.h.

References DebugAssert, casa::SPolynomialParam< T >::order(), and casa::Function< T >::param_p.

template<class T>
Vector<T> casa::SPolynomialParam< T >::coefficients ( ) const

Return all the coefficients as a vector.

template<class T>
virtual const String& casa::SPolynomialParam< T >::name ( ) const [inline, virtual]

Give name of function.

Reimplemented from casa::Function< T >.

Definition at line 136 of file SPolynomialParam.h.

template<class T>
virtual uInt casa::SPolynomialParam< T >::ndim ( ) const [inline, virtual]

Returns the dimension of function.

Implements casa::Function< T >.

Definition at line 158 of file SPolynomialParam.h.

template<class T>
Bool casa::SPolynomialParam< T >::operator!= ( const SPolynomialParam< T > &  other) const [inline]

Definition at line 130 of file SPolynomialParam.h.

References casa::Function< T >::param_p.

template<class T>
SPolynomialParam<T>& casa::SPolynomialParam< T >::operator= ( const SPolynomialParam< T > &  other)
template<class T>
Bool casa::SPolynomialParam< T >::operator== ( const SPolynomialParam< T > &  other) const [inline]

Comparisons.

SPolynomials are equal if they are of the same order

Definition at line 128 of file SPolynomialParam.h.

References casa::Function< T >::param_p.

template<class T>
uInt casa::SPolynomialParam< T >::order ( ) const [inline]

What is the order of the polynomial, i.e.

maximum exponent of "x".

Definition at line 140 of file SPolynomialParam.h.

References casa::Function< T >::param_p.

Referenced by casa::SPolynomialParam< T >::coefficient(), and casa::SPolynomialParam< T >::setCoefficient().

template<class T>
void casa::SPolynomialParam< T >::setCoefficient ( uInt  which,
const T  value 
) [inline]

Set the which'th coefficient to value.

Definition at line 151 of file SPolynomialParam.h.

References DebugAssert, casa::SPolynomialParam< T >::order(), casa::Function< T >::param_p, and casa::value().

template<class T>
void casa::SPolynomialParam< T >::setCoefficients ( const Vector< T > &  coefficients)

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


The documentation for this class was generated from the following file: