Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://www.atnf.csiro.au/computing/software/casacore/casacore-1.2.0/doc/html/classcasa_1_1CombiFunction.html
Дата изменения: Unknown Дата индексирования: Mon Feb 14 22:12:17 2011 Кодировка: Поисковые слова: п п п п п п п п п п п п п п п п п п п п п |
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:
f(x) = a(0)*f(0)(x) + a(1)*f(1)(x) + ... + a(N-1)*f(N-1)(x)
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 111 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 40 of file CombiFunction.h.
casa::CombiFunction< T >::CombiFunction | ( | const CombiFunction< T > & | other | ) | [inline] |
Make this object a (deep) copy of other.
Definition at line 43 of file CombiFunction.h.
casa::CombiFunction< T >::CombiFunction | ( | const CombiFunction< T > & | other, | |
Bool | ||||
) | [inline] |
Definition at line 45 of file CombiFunction.h.
casa::CombiFunction< T >::CombiFunction | ( | const CombiFunction< W > & | other | ) | [inline] |
Definition at line 48 of file CombiFunction.h.
casa::CombiFunction< T >::CombiFunction | ( | const CombiFunction< W > & | other, | |
Bool | ||||
) | [inline] |
Definition at line 50 of file CombiFunction.h.
virtual casa::CombiFunction< T >::~CombiFunction | ( | ) | [inline, virtual] |
Destructor.
Definition at line 58 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 68 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 69 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 71 of file CombiFunction.h.
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 54 of file CombiFunction.h.