casa
$Rev:20696$
|
Form a linear combination of function objects. More...
#include <CombiFunction.h>
Public Member Functions | |
CombiFunction () | |
The default constructor -- no functions, no parameters, nothing, the function operator returns a 0. | |
CombiFunction (const CombiFunction< T > &other) | |
Make this object a (deep) copy of other. | |
CombiFunction (const CombiFunction< T > &other, Bool) | |
template<class W > | |
CombiFunction (const CombiFunction< W > &other) | |
template<class W > | |
CombiFunction (const CombiFunction< W > &other, Bool) | |
CombiFunction< T > & | operator= (const CombiFunction< T > &other) |
Make this object a (deep) copy of other. | |
virtual | ~CombiFunction () |
Destructor. | |
virtual T | eval (typename Function< T >::FunctionArg x) const |
Evaluate the function at x . | |
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 |
Form a linear combination of function objects.
Public interface
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.
Tip: Check CompoundFunction class for a combination of functions behaving as one object;
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 CombiFunction<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 114 of file CombiFunction.h.
casa::CombiFunction< T >::CombiFunction | ( | ) | [inline] |
The default constructor -- no functions, no parameters, nothing, the function operator returns a 0.
Definition at line 119 of file CombiFunction.h.
casa::CombiFunction< T >::CombiFunction | ( | const CombiFunction< T > & | other | ) | [inline] |
Make this object a (deep) copy of other.
Definition at line 122 of file CombiFunction.h.
casa::CombiFunction< T >::CombiFunction | ( | const CombiFunction< T > & | other, |
Bool | |||
) | [inline] |
Definition at line 124 of file CombiFunction.h.
casa::CombiFunction< T >::CombiFunction | ( | const CombiFunction< W > & | other | ) | [inline] |
Definition at line 127 of file CombiFunction.h.
casa::CombiFunction< T >::CombiFunction | ( | const CombiFunction< W > & | other, |
Bool | |||
) | [inline] |
Definition at line 129 of file CombiFunction.h.
virtual casa::CombiFunction< T >::~CombiFunction | ( | ) | [inline, virtual] |
Destructor.
Definition at line 137 of file CombiFunction.h.
virtual Function<T>* casa::CombiFunction< T >::clone | ( | ) | const [inline, virtual] |
Return a copy of this object from the heap.
The caller is responsible for deleting the pointer.
Implements casa::Function< T >.
Definition at line 147 of file CombiFunction.h.
virtual Function<typename FunctionTraits<T>::DiffType>* casa::CombiFunction< T >::cloneAD | ( | ) | const [inline, virtual] |
Reimplemented from casa::Function< T >.
Definition at line 148 of file CombiFunction.h.
virtual Function<typename FunctionTraits<T>::BaseType>* casa::CombiFunction< T >::cloneNonAD | ( | ) | const [inline, virtual] |
Reimplemented from casa::Function< T >.
Definition at line 150 of file CombiFunction.h.
References casa::True.
virtual T casa::CombiFunction< T >::eval | ( | typename Function< T >::FunctionArg | x | ) | const [virtual] |
Evaluate the function at x
.
CombiFunction<T>& casa::CombiFunction< T >::operator= | ( | const CombiFunction< T > & | other | ) | [inline] |
Make this object a (deep) copy of other.
Definition at line 133 of file CombiFunction.h.