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

Parameter handling for a constant function in a space of arbitrary dimensionality. More...

#include <ConstantNDParam.h>

Inheritance diagram for casa::ConstantNDParam< T >:
casa::Function< T > casa::Functional< FunctionTraits< T >::ArgType, T > casa::Functional< Vector< FunctionTraits< T >::ArgType >, T > casa::ConstantND< T >

List of all members.

Public Member Functions

 ConstantNDParam (uInt m=0)
 Construct a constant in m-dimensional space.
 ConstantNDParam (const ConstantNDParam &other)
 Copy constructor (deep copy)
template<class W >
 ConstantNDParam (const ConstantNDParam< W > &other)
ConstantNDParam< T > & operator= (const ConstantNDParam< T > &other)
 Copy assignment (deep copy)
virtual ~ConstantNDParam ()
 Destructor.
Bool operator== (const ConstantNDParam< T > &other) const
 Comparisons.
Bool operator!= (const ConstantNDParam< T > &other) const
virtual const Stringname () const
 Give name of function.
virtual uInt ndim () const
 What is the dimension of the parameter list.

Private Attributes

uInt _ndim

Detailed Description

template<class T>
class casa::ConstantNDParam< T >

Parameter handling for a constant function in a space of arbitrary dimensionality.

Intended use:

Internal

Review Status

Test programs:
tConstant

Prerequisite

Synopsis

This class forms a function of the form f(x0,x1,..,xm-1) = constant in an m-dimensional parameter space where xi are independent arguments.

Since the Constant is a Function, the derivatives can be obtained as well (and in fact are 0 of course).

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 Constant class only.

Example

     form a constant function in 4-D space
     Constant<Double> constant(4); // constant in 4-D param space
     constant.parameters()[0] = 22;
     // Evaluate at x0=5, x3=7
     Vector<Double> x(4);
     x=0; x[0]=5; x[3]=7;
     cout << "constant value: " << constant(x) << endl;
     constant value: 22

Template Type Argument Requirements (T)

Thrown Exceptions

Motivation

This class was created because HyperPlane does not support a constant offset and modifying that class really required an interface change (ie that the constant offset be at the beginning of the parameter vector and that the parameter vector increase by one) so rather than breaking any code that already used HyperPlane I simply made a trivial Constant class.

To Do

Definition at line 105 of file ConstantNDParam.h.


Constructor & Destructor Documentation

template<class T>
casa::ConstantNDParam< T >::ConstantNDParam ( uInt  m = 0) [explicit]

Construct a constant in m-dimensional space.

By default, the constant value is initialized to zero.

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

Copy constructor (deep copy)

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

Definition at line 119 of file ConstantNDParam.h.

template<class T>
virtual casa::ConstantNDParam< T >::~ConstantNDParam ( ) [virtual]

Destructor.


Member Function Documentation

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

Give name of function.

Reimplemented from casa::Function< T >.

Definition at line 142 of file ConstantNDParam.h.

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

What is the dimension of the parameter list.

Implements casa::Function< T >.

Definition at line 146 of file ConstantNDParam.h.

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

Definition at line 136 of file ConstantNDParam.h.

template<class T>
ConstantNDParam<T>& casa::ConstantNDParam< T >::operator= ( const ConstantNDParam< T > &  other)

Copy assignment (deep copy)

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

Comparisons.

HyperPlanes are equal if they are of the same order and have the same parameters

Definition at line 134 of file ConstantNDParam.h.


Member Data Documentation

template<class T>
uInt casa::ConstantNDParam< T >::_ndim [private]

Definition at line 154 of file ConstantNDParam.h.

Referenced by casa::ConstantNDParam< AutoDiff< T > >::ndim().


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