Loading...
Searching...
No Matches
casacore::Function< T, U > Class Template Referenceabstract
scimath package (libcasa_scimath) » Functionals_module

More...

`#include <Function.h>`

## Public Types

typedef FunctionTraits< T >::ArgType | ArgType
typedef const ArgType * | FunctionArg

## Public Member Functions

| Function ()
| Constructors.
| Function (const uInt n)
| Function (const Vector< T > &in)
| Function (const FunctionParam< T > &other)
template<class W, class X>
| Function (const Function< W, X > &other)
virtual | ~Function ()
| Destructor.
virtual uInt | ndim () const =0
| Returns the number of dimensions of function.
uInt | nparameters () const
| Returns the number of parameters.
virtual U | eval (FunctionArg x) const =0
| Evaluate the function object.
T & | operator[] (const uInt n)
| Manipulate the nth parameter (0-based) with no index check.
const T & | operator[] (const uInt n) const
virtual U | operator() () const
| Evaluate this function object at xor at x, y.
virtual U | operator() (const ArgType &x) const
virtual U | operator() (const Vector< ArgType > &x) const
virtual U | operator() (FunctionArg x) const
virtual U | operator() (const ArgType &x, const ArgType &y) const
virtual U | operator() (const ArgType &x, const ArgType &y, const ArgType &z) const
virtual const String & | name () const
| Specify the name associated with the function (default will be unknown).
Bool & | mask (const uInt n)
| Manipulate the mask associated with the nth parameter (e.g.
const Bool & | mask (const uInt n) const
const FunctionParam< T > & | parameters () const
| Return the parameter interface.
FunctionParam< T > & | parameters ()
const Vector< ArgType > & | argp () const
| Get arg_p and parset_p.
Bool | parsetp () const
void | lockParam ()
| Compiler cannot always find the correct 'const' version of parameter access.
void | unlockParam ()
virtual void | setMode (const RecordInterface &mode)
| get/set the function mode.
virtual void | getMode (RecordInterface &mode) const
virtual Bool | hasMode () const
| return True if the implementing function supports a mode.
ostream & | print (ostream &os) const
| Print the function (i.e.
virtual Function< T, U > * | clone () const =0
| 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
Public Member Functions inherited from casacore::Functional< FunctionTraits< T >::ArgType, T >
virtual | ~Functional ()
| Destructor.
virtual T | operator() (const FunctionTraits< T >::ArgType &x) const=0
| Map a Domain x into a Range y value.
Public Member Functions inherited from casacore::Functional< Vector< FunctionTraits< T >::ArgType >, T >
virtual | ~Functional ()
| Destructor.
virtual T | operator() (const Vector< FunctionTraits< T >::ArgType > &x) const=0
| Map a Domain x into a Range y value.

## Protected Attributes

FunctionParam< T > | param_p
| The parameters and masks.
Vector< ArgType > | arg_p
| Aid for non-contiguous argument storage.
Bool | parset_p
| Indicate parameter written.
Bool | locked_p
| Indicate that parameters are expected to be locked from changing.

## Detailed Description

template<class T, class U = T>
class casacore::Function< T, U >

Numerical functional interface class

### Intended use:

Public interface

### Review Status

Reviewed By:
  tcornwel
Date Reviewed:
  1996/02/22
Test programs:
  tGaussian2D

### Prerequisite

- Functional
- FunctionParam

### Synopsis

A Function is used for classes which map a scalar or n-dimensional Vector of type T into a T. The object also has zero or more parameters which can be masked if necessary, and be used in the Fitting module, and, implicitly, in the AutoDiff differentiation module.

The parameter interface is provided by the FunctionParam class.

A Function can have a name() which can be used in generic interfaces.

The function calls implemented are:

- operator()()
- operator()(const T &x)
- operator()(const Vector<T> &x)
- operator()(Function::FunctionArg x)
- operator()(const T &x, const T &y) (for 2D)
- operator()(const T &x, const T &y, const T &z) (for 3D)

The T in the above is the Function::ArgType as derived from the FunctionTraits class. These calls are (in debug mode) tested for the correct number of arguments, after which they call a T eval(FunctionArg x) const = 0 to be implemented in derived classes. The derived class should also implement an uInt ndim() const = 0. The derived class can access the nth parameter with the [n] operator, and the corresponding mask with mask(n) method. The variables are referenced with x[i].

### Example

A complete implementation of say an A.sin(2pi.f.x) with parameters amplitude(A) and frequency(f) and variable time(x) could be:

//# Sinusoid.h
#include <casacore/casa/aips.h>
#include <casacore/scimath/Functionals/Function.h>
#include <casacore/casa/BasicSL/Constants.h>
#include <casacore/casa/BasicMath/Math.h>
// The sinusoid class
template<class T> class Sinusoid : public Function<T> {
public:
// For easy reference of the parameters
enum { AMPL=0, FREQ };
// Constructors. Defaults are A=1, f=1
Sinusoid() : Function<T>(2) {
param_p[AMPL] = T(1.0); param_p[FREQ] = T(1.0); }
explicit Sinusoid(const T &ampl) : Function<T>(2) {
param_p[AMPL] = ampl; param_p[FREQ] = T(1.0); }
Sinusoid(const T &ampl, const T &freq) : Function<T>(2) {
param_p[AMPL] = ampl; param_p[FREQ] = freq; }
Sinusoid(const Sinusoid &other) : Function<T>(2) {
param_p[AMPL] = other.param_p[AMPL];
param_p[FREQ] = other.parameter[FREQ]; }
Sinusoid<T> &operator=(const Sinusoid<T> &other) {
if (this != &other) param_p = other.param_p;
return *this; }
virtual ~Sinusoid() {}
// Dimensionality
virtual uInt ndim() const { return 2; }
// Evaluate
virtual T eval(Function<T>::FunctionArg x) const {
return param_p[AMPL]*sin(T(C::_2pi)*param_p[FREQ]*x[0]); }
// Copy it
virtual Function<T> *clone() const { return new Sinusoid<T>(param_p); }
};
casacore::Function
Definition Function.h:200
casacore::Function::param_p
FunctionParam< T > param_p
The parameters and masks.
Definition Function.h:330
casacore::Function::Function
Function()
Constructors.
Definition Function.h:210
casacore::ndim
LatticeExprNode ndim(const LatticeExprNode &expr)
1-argument function to get the dimensionality of a lattice.
casacore::uInt
unsigned int uInt
Definition aipstype.h:49
casacore::sin
LatticeExprNode sin(const LatticeExprNode &expr)
Numerical 1-argument functions.
casacore::operator=
Record & operator=(const Record &other)
Copy the data in the other record to this record.
casacore::eval
virtual T eval(typename Function1D< T >::FunctionArg x) const
Evaluate the polynomial at x.
casacore::clone
RecordInterface * clone() const override
Make a copy of this object.
Definition Polynomial.h:122

The following will calculate the value and the derivative for A=2; f=3; x=0.1;

// The function objects for value, and for value + derivative
Sinusoid<Double> soid1(2.0, 3.0);
typedef AutoDiff<Double> Adif;
Sinusoid<Adif> soid2(Adif(2,2,0), Adif(3,2,1));
cout << "Value: " << soid1(0.1) << endl;
cout << "(val, deriv): " << soid2(Adif(0.1)) << endl;
casacore::AutoDiff
Definition AutoDiff.h:254

A shorter version, where all parameter handling is done at user level could be:

//# Sinusoid.h
#include <casacore/casa/aips.h>
#include <casacore/scimath/Functionals/Function.h>
#include <casacore/casa/BasicSL/Constants.h>
#include <casacore/casa/BasicMath/Math.h>
template<class T> class Sinusoid : public Function<T> {
public:
enum { AMPL=0, FREQ };
Sinusoid() : Function<T>(2){param_p[AMPL] T(1);param_p[FREQ]=T(1);}
virtual ~Sinusoid() {}
virtual uInt ndim() const { return 2; }
virtual T eval(Function<T>::FunctionArg x) const {
return param_p[AMPL]*sin(T(C::_2pi)*param_p[FREQ]*x[0]); }
virtual Function<T> *clone() const { return new Sinusoid<T>param_p; }
};

The following will calculate the value and the derivative for A=2; f=3; x=0.1;

// The function objects for value, and for value + derivative
typedef AutoDiff<Double> Adif;
typedef Function<Double> FD;
typedef Function<AutoDiff<Double> > FAdif
Sinusoid<Double> soid1;
Sinusoid<Adif> soid2;
soid1[FD::AMPL] = 2; soid1[FD::FREQ] = 3;
soid2[FAdif::AMPL] = Adif(2,2,0);
soid2[FAdif::FREQ] = Adif(3,2,1);
cout << "Value: " << soid1(0.1) << endl;
cout << "(val, deriv): " << soid2(Adif(0.1)) << endl;

### Motivation

A function of more than one variable was required for a function which represents the sky brightness. Adjustable parameters were required for non-linear least squares fitting.

### Template Type Argument Requirements (T)

- Besides the requirements set by the Functional base class, it must be possible to form a Vector<T>.

### To Do

- At some point, we may want to implement a letter-envelope class, implement function arithmetic, etc.
- use maybe Poolstack for static Vector

Definition at line 198 of file Function.h.

## Member Typedef Documentation

## ArgType

template<class T, class U = T>

typedef FunctionTraits<T>::ArgType casacore::Function< T, U >::ArgType

Definition at line 204 of file Function.h.

## FunctionArg

template<class T, class U = T>

typedef const ArgType* casacore::Function< T, U >::FunctionArg

Definition at line 205 of file Function.h.

## Constructor & Destructor Documentation

## Function() [1/5]

template<class T, class U = T>

casacore::Function< T, U >::Function | ( |  | ) |

inline

Constructors.

Definition at line 210 of file Function.h.

References arg_p, casacore::False, locked_p, param_p, and parset_p.

Referenced by casacore::CombiParam< T >::addFunction(), casacore::CompoundParam< T >::addFunction(), clone(), cloneAD(), casacore::CombiParam< T >::CombiParam(), casacore::CombiParam< T >::CombiParam(), casacore::CombiParam< T >::CombiParam(), casacore::CompiledParam< T >::CompiledParam(), casacore::CompoundParam< T >::CompoundParam(), casacore::CompoundParam< T >::CompoundParam(), casacore::CompoundParam< T >::CompoundParam(), casacore::ConstantNDParam< T >::ConstantNDParam(), casacore::DiracDParam< T >::DiracDParam(), Function(), casacore::CombiParam< T >::function(), casacore::CombiParam< T >::function(), casacore::CompoundParam< T >::function(), casacore::Gaussian2DParam< T >::Gaussian2DParam(), casacore::GaussianNDParam< T >::GaussianNDParam(), casacore::HyperPlaneParam< T >::HyperPlaneParam(), casacore::KaiserBParam< T >::KaiserBParam(), casacore::PoissonParam< T >::PoissonParam(), casacore::SincParam< T >::SincParam(), casacore::SPolynomialParam< T >::SPolynomialParam(), casacore::UnaryParam< T >::UnaryParam(), and casacore::GaussianNDParam< T >::unpack().

## Function() [2/5]

template<class T, class U = T>

casacore::Function< T, U >::Function | ( | const uInt | n | ) |

inline explicit

Definition at line 211 of file Function.h.

References arg_p, casacore::False, locked_p, param_p, and parset_p.

## Function() [3/5]

template<class T, class U = T>

casacore::Function< T, U >::Function | ( | const Vector< T > & | in | ) |

inline explicit

Definition at line 213 of file Function.h.

References arg_p, casacore::False, locked_p, param_p, and parset_p.

## Function() [4/5]

template<class T, class U = T>

casacore::Function< T, U >::Function | ( | const FunctionParam< T > & | other | ) |

inline

Definition at line 215 of file Function.h.

References arg_p, casacore::False, locked_p, param_p, and parset_p.

## Function() [5/5]

template<class T, class U = T>
template<class W, class X>

casacore::Function< T, U >::Function | ( | const Function< W, X > & | other | ) |

inline

Definition at line 218 of file Function.h.

References arg_p, casacore::False, Function(), locked_p, param_p, parameters(), parset_p, and parsetp().

## ~Function()

template<class T, class U = T>

virtual casacore::Function< T, U >::~Function | ( |  | ) |

inline virtual

Destructor.

Definition at line 223 of file Function.h.

## Member Function Documentation

## argp()

template<class T, class U = T>

const Vector< ArgType > & casacore::Function< T, U >::argp | ( |  | ) | const

inline

Get arg_p and parset_p.

Necessary for reasons of protection in the copying of non-conforming Functions.

Definition at line 276 of file Function.h.

References arg_p.

## clone()

template<class T, class U = T>

virtual Function< T, U > * casacore::Function< T, U >::clone | ( |  | ) | const

pure virtual

Return a copy of this object from the heap.

The caller is responsible for deleting this pointer. The cloneAD will return a clone with an AutoDef<T>; the cloneNonAD a clone with <T>. An AipsError will be thrown if the cloneAD() or cloneNonAD() is not implemented for a specific function.

Implemented in casacore::Chebyshev< T >, casacore::CombiFunction< T >, casacore::CombiFunction_PS< AutoDiff< T > >, casacore::CompiledFunction< T >, casacore::CompoundFunction< T >, casacore::CompoundFunction< casacore::AutoDiff< Double > >, casacore::CompoundFunction_PS< AutoDiff< T > >, casacore::ConstantND< T >, casacore::ConstantND_PS< AutoDiff< T > >, casacore::DiracDFunction< T >, casacore::EvenPolynomial< T >, casacore::EvenPolynomial_PS< AutoDiff< T > >, casacore::FunctionWrapper< T >, casacore::Gaussian1D< T >, casacore::Gaussian1D_PS< AutoDiff< T > >, casacore::Gaussian2D< T >, casacore::Gaussian2D_PS< AutoDiff< T > >, casacore::Gaussian3D< T >, casacore::Gaussian3D_PS< AutoDiff< T > >, casacore::GaussianND< T >, casacore::GNoiseFunction< T >, casacore::HyperPlane< T >, casacore::HyperPlane_PS< AutoDiff< T > >, casacore::Interpolate1D< Domain, Range >, casacore::Interpolate1D< Double, Double >, casacore::KaiserBFunction< T >, casacore::Lorentzian1D< T >, casacore::Lorentzian1D_PS< AutoDiff< T > >, casacore::MarshallableChebyshev< T >, casacore::MarshButterworthBandpass< T >, casacore::OddPolynomial< T >, casacore::OddPolynomial_PS< AutoDiff< T > >, casacore::PoissonFunction< T >, casacore::PoissonFunction_PS< AutoDiff< T > >, casacore::PowerLogarithmicPolynomial< T >, casacore::PowerLogarithmicPolynomial_PS< AutoDiff< T > >, casacore::SimButterworthBandpass< T >, casacore::SincFunction< T >, casacore::Sinusoid1D< T >, casacore::Sinusoid1D_PS< AutoDiff< T > >, casacore::SPolynomial< T >, and casacore::UnaryFunction< T >.

References Function().

Referenced by casacore::CombiParam< T >::CombiParam().

## cloneAD()

template<class T, class U = T>

virtual Function< typename FunctionTraits< T >::DiffType > * casacore::Function< T, U >::cloneAD | ( |  | ) | const

virtual

Reimplemented in casacore::CombiFunction< T >, casacore::CombiFunction_PS< AutoDiff< T > >, casacore::CompiledFunction< T >, casacore::CompoundFunction< T >, casacore::CompoundFunction< casacore::AutoDiff< Double > >, casacore::CompoundFunction_PS< AutoDiff< T > >, casacore::ConstantND< T >, casacore::ConstantND_PS< AutoDiff< T > >, casacore::DiracDFunction< T >, casacore::EvenPolynomial< T >, casacore::EvenPolynomial_PS< AutoDiff< T > >, casacore::Gaussian1D< T >, casacore::Gaussian1D_PS< AutoDiff< T > >, casacore::Gaussian2D< T >, casacore::Gaussian2D_PS< AutoDiff< T > >, casacore::Gaussian3D< T >, casacore::Gaussian3D_PS< AutoDiff< T > >, casacore::HyperPlane< T >, casacore::HyperPlane_PS< AutoDiff< T > >, casacore::KaiserBFunction< T >, casacore::Lorentzian1D< T >, casacore::Lorentzian1D_PS< AutoDiff< T > >, casacore::OddPolynomial< T >, casacore::OddPolynomial_PS< AutoDiff< T > >, casacore::PoissonFunction< T >, casacore::PoissonFunction_PS< AutoDiff< T > >, casacore::PowerLogarithmicPolynomial< T >, casacore::PowerLogarithmicPolynomial_PS< AutoDiff< T > >, casacore::SincFunction< T >, casacore::Sinusoid1D< T >, casacore::Sinusoid1D_PS< AutoDiff< T > >, casacore::SPolynomial< T >, and casacore::UnaryFunction< T >.

References Function().

Referenced by casacore::GenericL2Fit< T >::setConstraint(), and casacore::GenericL2Fit< T >::setFunction().

## cloneNonAD()

template<class T, class U = T>

virtual Function< typename FunctionTraits< T >::BaseType > * casacore::Function< T, U >::cloneNonAD | ( |  | ) | const

virtual

Reimplemented in casacore::CombiFunction< T >, casacore::CombiFunction_PS< AutoDiff< T > >, casacore::CompiledFunction< T >, casacore::CompoundFunction< T >, casacore::CompoundFunction< casacore::AutoDiff< Double > >, casacore::CompoundFunction_PS< AutoDiff< T > >, casacore::ConstantND< T >, casacore::ConstantND_PS< AutoDiff< T > >, casacore::DiracDFunction< T >, casacore::EvenPolynomial< T >, casacore::EvenPolynomial_PS< AutoDiff< T > >, casacore::Gaussian1D< T >, casacore::Gaussian1D_PS< AutoDiff< T > >, casacore::Gaussian2D< T >, casacore::Gaussian2D_PS< AutoDiff< T > >, casacore::Gaussian3D< T >, casacore::Gaussian3D_PS< AutoDiff< T > >, casacore::HyperPlane< T >, casacore::HyperPlane_PS< AutoDiff< T > >, casacore::KaiserBFunction< T >, casacore::Lorentzian1D< T >, casacore::Lorentzian1D_PS< AutoDiff< T > >, casacore::OddPolynomial< T >, casacore::OddPolynomial_PS< AutoDiff< T > >, casacore::PoissonFunction< T >, casacore::PoissonFunction_PS< AutoDiff< T > >, casacore::PowerLogarithmicPolynomial< T >, casacore::PowerLogarithmicPolynomial_PS< AutoDiff< T > >, casacore::SincFunction< T >, casacore::Sinusoid1D< T >, casacore::Sinusoid1D_PS< AutoDiff< T > >, casacore::SPolynomial< T >, and casacore::UnaryFunction< T >.

## eval()

template<class T, class U = T>

virtual U casacore::Function< T, U >::eval | ( | FunctionArg | x | ) | const

pure virtual

Evaluate the function object.

Referenced by operator()(), operator()(), and operator()().

## getMode()

template<class T, class U = T>

virtual void casacore::Function< T, U >::getMode | ( | RecordInterface & | mode | ) | const

virtual

Reimplemented in casacore::ChebyshevParamModeImpl< T >, casacore::ChebyshevParamModeImpl_PS< AutoDiff< T > >, casacore::ChebyshevParamModeImpl_PSA< AutoDiffA< T > >, and casacore::SimButterworthBandpass< T >.

References casacore::RecordInterface().

## hasMode()

template<class T, class U = T>

virtual Bool casacore::Function< T, U >::hasMode | ( |  | ) | const

virtual

return True if the implementing function supports a mode.

The default implementation returns False.

Reimplemented in casacore::ChebyshevParamModeImpl< T >, and casacore::SimButterworthBandpass< T >.

## lockParam()

template<class T, class U = T>

void casacore::Function< T, U >::lockParam | ( |  | ) |

inline

Compiler cannot always find the correct 'const' version of parameter access.

In cases where this would lead to excessive overheads in moving parameters around (like in CompoundFunction) the parameter changing can be set to be locked, and no changes are assumed.

Definition at line 285 of file Function.h.

References locked_p, and casacore::True.

## mask() [1/2]

template<class T, class U = T>

Bool & casacore::Function< T, U >::mask | ( | const uInt | n | ) |

inline

Manipulate the mask associated with the nth parameter (e.g.

to indicate whether the parameter is adjustable or nonadjustable). Note: no index check.

Definition at line 264 of file Function.h.

References locked_p, param_p, and parset_p.

## mask() [2/2]

template<class T, class U = T>

const Bool & casacore::Function< T, U >::mask | ( | const uInt | n | ) | const

inline

Definition at line 266 of file Function.h.

References param_p.

## name()

template<class T, class U = T>

virtual const String & casacore::Function< T, U >::name | ( |  | ) | const

virtual

Specify the name associated with the function (default will be unknown).

Reimplemented in casacore::ChebyshevParam< T >, casacore::ChebyshevParam< AutoDiff< T > >, casacore::ChebyshevParam< AutoDiffA< T > >, casacore::CombiParam< T >, casacore::CombiParam< AutoDiff< T > >, casacore::CompiledParam< T >, casacore::CompoundParam< T >, casacore::CompoundParam< AutoDiff< T > >, casacore::CompoundParam< casacore::AutoDiff< Double > >, casacore::ConstantNDParam< T >, casacore::ConstantNDParam< AutoDiff< T > >, casacore::DiracDParam< T >, casacore::EvenPolynomialParam< T >, casacore::EvenPolynomialParam< AutoDiff< T > >, casacore::Gaussian1DParam< T >, casacore::Gaussian1DParam< AutoDiff< T > >, casacore::Gaussian2DParam< T >, casacore::Gaussian2DParam< AutoDiff< T > >, casacore::Gaussian3DParam< Type >, casacore::Gaussian3DParam< AutoDiff< T > >, casacore::Gaussian3DParam< T >, casacore::GaussianNDParam< T >, casacore::GNoiseParam< T >, casacore::HyperPlaneParam< T >, casacore::HyperPlaneParam< AutoDiff< T > >, casacore::Interpolate1D< Domain, Range >, casacore::Interpolate1D< Double, Double >, casacore::KaiserBParam< T >, casacore::Lorentzian1DParam< T >, casacore::Lorentzian1DParam< AutoDiff< T > >, casacore::OddPolynomialParam< T >, casacore::OddPolynomialParam< AutoDiff< T > >, casacore::PoissonParam< T >, casacore::PoissonParam< AutoDiff< T > >, casacore::PowerLogarithmicPolynomialParam< T >, casacore::PowerLogarithmicPolynomialParam< AutoDiff< T > >, casacore::SincParam< T >, casacore::Sinusoid1DParam< T >, casacore::Sinusoid1DParam< AutoDiff< T > >, casacore::SPolynomialParam< T >, casacore::UnaryParam< T >, and casacore::WrapperParam< T >.

## ndim()

template<class T, class U = T>

virtual uInt casacore::Function< T, U >::ndim | ( |  | ) | const

pure virtual

Returns the number of dimensions of function.

Implemented in casacore::CombiParam< T >, casacore::CombiParam< AutoDiff< T > >, casacore::CompiledParam< T >, casacore::CompoundParam< T >, casacore::CompoundParam< AutoDiff< T > >, casacore::CompoundParam< casacore::AutoDiff< Double > >, casacore::ConstantNDParam< T >, casacore::ConstantNDParam< AutoDiff< T > >, casacore::DiracDParam< T >, casacore::Function1D< T, U >, casacore::Function1D< Domain, Range >, casacore::Function1D< Double, Double >, casacore::FunctionWrapper< T >, casacore::Gaussian2DParam< T >, casacore::Gaussian2DParam< AutoDiff< T > >, casacore::Gaussian3DParam< Type >, casacore::Gaussian3DParam< AutoDiff< T > >, casacore::Gaussian3DParam< T >, casacore::GaussianNDParam< T >, casacore::GNoiseParam< T >, casacore::HyperPlaneParam< T >, casacore::HyperPlaneParam< AutoDiff< T > >, casacore::KaiserBParam< T >, casacore::PoissonParam< T >, casacore::PoissonParam< AutoDiff< T > >, casacore::SincParam< T >, casacore::SPolynomialParam< T >, and casacore::UnaryParam< T >.

Referenced by operator()(), operator()(), and casacore::GenericL2Fit< T >::setConstraint().

## nparameters()

template<class T, class U = T>

uInt casacore::Function< T, U >::nparameters | ( |  | ) | const

inline

Returns the number of parameters.

Definition at line 228 of file Function.h.

References param_p.

Referenced by casacore::CompoundParam< T >::CompoundParam(), casacore::CompoundParam< T >::CompoundParam(), casacore::CombiParam< T >::nFunctions(), casacore::CompoundParam< T >::parameterFunction(), casacore::CompoundParam< T >::parameterLocation(), casacore::GenericL2Fit< T >::setConstraint(), casacore::CompoundFunction< T >::toParam_p(), casacore::CompoundFunction_PS< AutoDiff< T > >::toParam_p(), and casacore::GaussianNDParam< T >::unpack().

## operator()() [1/6]

template<class T, class U = T>

virtual U casacore::Function< T, U >::operator() | ( |  | ) | const

inline virtual

Evaluate this function object at xor at x, y.

The length of x must be greater than or equal to ndim().

Definition at line 244 of file Function.h.

References DebugAssert, eval(), and ndim().

## operator()() [2/6]

template<class T, class U = T>

virtual U casacore::Function< T, U >::operator() | ( | const ArgType & | x | ) | const

inline virtual

Definition at line 246 of file Function.h.

References DebugAssert, eval(), and ndim().

## operator()() [3/6]

template<class T, class U = T>

virtual U casacore::Function< T, U >::operator() | ( | const ArgType & | x,
|  | const ArgType & | y ) const

virtual

## operator()() [4/6]

template<class T, class U = T>

virtual U casacore::Function< T, U >::operator() | ( | const ArgType & | x,
|  | const ArgType & | y,
|  | const ArgType & | z ) const

virtual

## operator()() [5/6]

template<class T, class U = T>

virtual U casacore::Function< T, U >::operator() | ( | const Vector< ArgType > & | x | ) | const

virtual

## operator()() [6/6]

template<class T, class U = T>

virtual U casacore::Function< T, U >::operator() | ( | FunctionArg | x | ) | const

inline virtual

Definition at line 249 of file Function.h.

References eval().

## operator[]() [1/2]

template<class T, class U = T>

T & casacore::Function< T, U >::operator[] | ( | const uInt | n | ) |

inline

Manipulate the nth parameter (0-based) with no index check.

Definition at line 236 of file Function.h.

References locked_p, param_p, and parset_p.

## operator[]() [2/2]

template<class T, class U = T>

const T & casacore::Function< T, U >::operator[] | ( | const uInt | n | ) | const

inline

Definition at line 238 of file Function.h.

References param_p.

## parameters() [1/2]

template<class T, class U = T>

FunctionParam< T > & casacore::Function< T, U >::parameters | ( |  | ) |

inline

Definition at line 271 of file Function.h.

References param_p, parset_p, and casacore::True.

## parameters() [2/2]

template<class T, class U = T>

const FunctionParam< T > & casacore::Function< T, U >::parameters | ( |  | ) | const

inline

Return the parameter interface.

Definition at line 270 of file Function.h.

References param_p.

Referenced by Function().

## parsetp()

template<class T, class U = T>

Bool casacore::Function< T, U >::parsetp | ( |  | ) | const

inline

Definition at line 277 of file Function.h.

References parset_p.

Referenced by Function().

## print()

template<class T, class U = T>

ostream & casacore::Function< T, U >::print | ( | ostream & | os | ) | const

inline

Print the function (i.e.

the parameters)

Definition at line 313 of file Function.h.

References param_p.

Referenced by casacore::operator<<().

## setMode()

template<class T, class U = T>

virtual void casacore::Function< T, U >::setMode | ( | const RecordInterface & | mode | ) |

virtual

get/set the function mode.

These provide an interface to function-specific configuration or state that controls how the function calculates its values but otherwise does not qualify as a parameter. Some part of the state, for example, might have a type different from that of T. The state is passed as fields of a record, mode–the names, types and values of which are specific to the implementing function and should be documented in the implementing class. It is recommended that all possible inputs passed to this function via setMode() be considered optional such that if the record omits a legal field, that part of the state is left unchanged. Fields not recognized by the implementing class should be ignored. An exception should be thrown if a recognized field contains illegal data. The default implementations for both getMode() and setMode() ignore the input record.

Reimplemented in casacore::ChebyshevParamModeImpl< T >, casacore::ChebyshevParamModeImpl_PS< AutoDiff< T > >, casacore::ChebyshevParamModeImpl_PSA< AutoDiffA< T > >, and casacore::SimButterworthBandpass< T >.

References casacore::RecordInterface().

## unlockParam()

template<class T, class U = T>

void casacore::Function< T, U >::unlockParam | ( |  | ) |

inline

Definition at line 286 of file Function.h.

References casacore::False, and locked_p.

## Member Data Documentation

## arg_p

template<class T, class U = T>

Vector<ArgType> casacore::Function< T, U >::arg_p

mutable protected

Aid for non-contiguous argument storage.

Definition at line 332 of file Function.h.

Referenced by argp(), Function(), Function(), Function(), Function(), and Function().

## locked_p

template<class T, class U = T>

Bool casacore::Function< T, U >::locked_p

mutable protected

Indicate that parameters are expected to be locked from changing.

Definition at line 336 of file Function.h.

Referenced by Function(), Function(), Function(), Function(), Function(), lockParam(), mask(), operator[](), and unlockParam().

## param_p

template<class T, class U = T>

FunctionParam<T> casacore::Function< T, U >::param_p

protected

The parameters and masks.

Definition at line 330 of file Function.h.

Referenced by casacore::SPolynomialParam< T >::coefficient(), Function(), Function(), Function(), Function(), Function(), casacore::Gaussian2DParam< T >::height(), casacore::GaussianNDParam< T >::height(), casacore::PoissonParam< T >::height(), casacore::PoissonParam< T >::lambda(), mask(), mask(), casacore::HyperPlaneParam< T >::ndim(), nparameters(), casacore::ConstantNDParam< T >::operator!=(), casacore::EvenPolynomialParam< T >::operator!=(), casacore::HyperPlaneParam< T >::operator!=(), casacore::OddPolynomialParam< T >::operator!=(), casacore::PowerLogarithmicPolynomialParam< T >::operator!=(), casacore::SPolynomialParam< T >::operator!=(), casacore::ConstantNDParam< T >::operator==(), casacore::EvenPolynomialParam< T >::operator==(), casacore::HyperPlaneParam< T >::operator==(), casacore::OddPolynomialParam< T >::operator==(), casacore::PowerLogarithmicPolynomialParam< T >::operator==(), casacore::SPolynomialParam< T >::operator==(), operator[](), operator[](), casacore::SPolynomialParam< T >::order(), parameters(), parameters(), print(), casacore::SPolynomialParam< T >::setCoefficient(), casacore::Gaussian2DParam< T >::setHeight(), casacore::GaussianNDParam< T >::setHeight(), casacore::PoissonParam< T >::setHeight(), casacore::PoissonParam< T >::setLambda(), casacore::Gaussian2DParam< T >::setXcenter(), casacore::Gaussian2DParam< T >::setYcenter(), casacore::Gaussian3D< T >::sq(), casacore::CompoundFunction< T >::toParam_p(), casacore::CompoundFunction_PS< AutoDiff< T > >::toParam_p(), casacore::GaussianNDParam< T >::unpack(), casacore::Gaussian2DParam< T >::xCenter(), and casacore::Gaussian2DParam< T >::yCenter().

## parset_p

template<class T, class U = T>

Bool casacore::Function< T, U >::parset_p

mutable protected

Indicate parameter written.

Definition at line 334 of file Function.h.

Referenced by Function(), Function(), Function(), Function(), Function(), mask(), operator[](), parameters(), parsetp(), casacore::CompoundFunction< T >::toParam_p(), and casacore::CompoundFunction_PS< AutoDiff< T > >::toParam_p().

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

- scimath/Fitting/GenericL2Fit.h
- scimath/Functionals/Function.h