casa
$Rev:20696$
|
Parameters for a linear combination of function objects. More...
#include <CombiParam.h>
Public Member Functions | |
CombiParam () | |
The default constructor -- no functions, no parameters, nothing, the function operator returns a 0. | |
CombiParam (const CombiParam< T > &other) | |
Make this object a (deep) copy of other. | |
CombiParam (const CombiParam< T > &other, Bool) | |
template<class W > | |
CombiParam (const CombiParam< W > &other) | |
template<class W > | |
CombiParam (const CombiParam< W > &other, Bool) | |
CombiParam< T > & | operator= (const CombiParam< T > &other) |
Make this object a (deep) copy of other. | |
virtual | ~CombiParam () |
Destructor. | |
virtual const String & | name () const |
Give name of function. | |
uInt | addFunction (const Function< T > &newFunction) |
Add a function. | |
uInt | nFunctions () const |
Return the total number of functions. | |
const Function< T > & | function (uInt which) const |
Return a reference to a specific Function in the combination. | |
const Function< T > & | function (uInt which) |
virtual uInt | ndim () const |
Returns the dimension of functions in the linear combination. | |
Protected Attributes | |
uInt | ndim_p |
Number of dimensions of underlying functions. | |
PtrBlock< Function< T > * > | functionPtr_p |
Pointer to each added function. |
Parameters for a linear combination of function objects.
Internal
Given N function objects, the class describes a linear combination of the form:
where a = {a(n)} are parameters. If the combi function is used in a functional fitting process (see LinearFit ) these parameters canm be solved for. In all aspects they behave as FunctionParam values.
Member functions are added with the addFunction()
method.
In the following example a second order polynomial is built from 3 separate polynomials.
Polynomial<Double> constant(0); Polynomial<Double> linear(1); Polynomial<Double> square(2); constant.setCoefficient(0, 1.0); // 1 linear.setCoefficient(1, 1.0); // x square[2] = 1.0; // x^2 CombiParam<Double> combination; // form function, e0 + e1*x + e2*x^2 combination.addFunction(constant); combination.addFunction(linear); combination.addFunction(square);
This class was created to allow specialization of the evaluation in a simple way.
Definition at line 111 of file CombiParam.h.
casa::CombiParam< T >::CombiParam | ( | ) |
The default constructor -- no functions, no parameters, nothing, the function operator returns a 0.
casa::CombiParam< T >::CombiParam | ( | const CombiParam< T > & | other | ) |
Make this object a (deep) copy of other.
casa::CombiParam< T >::CombiParam | ( | const CombiParam< T > & | other, |
Bool | |||
) | [inline] |
Definition at line 121 of file CombiParam.h.
casa::CombiParam< T >::CombiParam | ( | const CombiParam< W > & | other | ) | [inline] |
Definition at line 129 of file CombiParam.h.
casa::CombiParam< T >::CombiParam | ( | const CombiParam< W > & | other, |
Bool | |||
) | [inline] |
Definition at line 137 of file CombiParam.h.
virtual casa::CombiParam< T >::~CombiParam | ( | ) | [virtual] |
Destructor.
uInt casa::CombiParam< T >::addFunction | ( | const Function< T > & | newFunction | ) |
Add a function.
All functions must have the same ndim()
as the first one. Returns the (zero relative) number (i
) of the function just added. The default initial parameter value (a(i)
) is initialized to 1. The parameter mask is set True
.
const Function<T>& casa::CombiParam< T >::function | ( | uInt | which | ) | const [inline] |
Return a reference to a specific Function in the combination.
Definition at line 170 of file CombiParam.h.
Referenced by casa::CombiParam< AutoDiff< T > >::CombiParam().
const Function<T>& casa::CombiParam< T >::function | ( | uInt | which | ) | [inline] |
Definition at line 173 of file CombiParam.h.
virtual const String& casa::CombiParam< T >::name | ( | ) | const [inline, virtual] |
Give name of function.
Reimplemented from casa::Function< T >.
Definition at line 154 of file CombiParam.h.
virtual uInt casa::CombiParam< T >::ndim | ( | ) | const [inline, virtual] |
Returns the dimension of functions in the linear combination.
Implements casa::Function< T >.
Definition at line 179 of file CombiParam.h.
uInt casa::CombiParam< T >::nFunctions | ( | ) | const [inline] |
Return the total number of functions.
The number is equal to the number of functions that have been added.
Definition at line 166 of file CombiParam.h.
Referenced by casa::CombiParam< AutoDiff< T > >::CombiParam(), and casa::CombiParam< AutoDiff< T > >::function().
CombiParam<T>& casa::CombiParam< T >::operator= | ( | const CombiParam< T > & | other | ) |
Make this object a (deep) copy of other.
PtrBlock<Function<T> *> casa::CombiParam< T >::functionPtr_p [protected] |
Pointer to each added function.
Definition at line 187 of file CombiParam.h.
Referenced by casa::CombiParam< AutoDiff< T > >::CombiParam(), and casa::CombiParam< AutoDiff< T > >::function().
uInt casa::CombiParam< T >::ndim_p [protected] |
Number of dimensions of underlying functions.
Definition at line 184 of file CombiParam.h.
Referenced by casa::CombiParam< AutoDiff< T > >::ndim().