|
casacore
|
#include <FunctionWrapper.h>
Public Member Functions | |
| FunctionWrapper () | |
| Default constructor, to enable arrays. | |
| FunctionWrapper (T(*f)()) | |
| A function with no parameters and no arguments. | |
| FunctionWrapper (T(*f)(const T &), const Bool isPar) | |
| A function with parameter and no arguments (Note value of isPar irrelevant) | |
| FunctionWrapper (T(*f)(const Vector< T > &), const Bool isPar) | |
| A function with parameters and no arguments. | |
| FunctionWrapper (T(*f)(const T &)) | |
| Construct a 1-dimensional function with no parameters. | |
| FunctionWrapper (T(*f)(const T &, const T &), const T &par) | |
| Construct a 1-dimensional function with parameter. | |
| FunctionWrapper (T(*f)(const T &, const Vector< T > &), const Vector< T > &par) | |
| Construct a 1-dimensional function with parameters. | |
| FunctionWrapper (T(*f)(const Vector< T > &), const Int dim=1) | |
| Construct an n-dimensional function with no parameters. | |
| FunctionWrapper (T(*f)(const Vector< T > &, const T &), const T &par, const uInt dim=1) | |
| Construct an n-dimensional function with parameter. | |
| FunctionWrapper (T(*f)(const Vector< T > &, const Vector< T > &), const Vector< T > &par, const uInt dim=1) | |
| Construct an n-dimensional function with parameters. | |
| FunctionWrapper (const FunctionWrapper< T > &other) | |
| Copy constructor (reference semantics) | |
| FunctionWrapper< T > & | operator= (const FunctionWrapper< T > &other) |
| Copy assignment (reference semantics) | |
| virtual | ~FunctionWrapper () |
| Destructor. | |
| virtual T | eval (typename Function< T >::FunctionArg x) const |
Evaluate the function at x. | |
| virtual uInt | ndim () const |
| Get the dimensionality. | |
| virtual Function< T > * | clone () const |
| Return a copy of this object from the heap. | |
Public Member Functions inherited from casacore::WrapperParam< T > | |
| WrapperParam () | |
| Construct with the given parameters. | |
| WrapperParam (const T &par) | |
| WrapperParam (const Vector< T > &par) | |
| WrapperParam (const WrapperParam< T > &other) | |
| Copy constructor (deep copy) | |
| WrapperParam< T > & | operator= (const WrapperParam< T > &other) |
| Copy assignment (deep copy) | |
| virtual | ~WrapperParam () |
| Destructor. | |
| virtual const String & | name () const |
| Give name of function. | |
Public Member Functions inherited from casacore::Function< T, U > | |
| 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. | |
| 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 |
| 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< typename FunctionTraits< T >::DiffType > * | cloneAD () const |
| virtual Function< typename FunctionTraits< T >::BaseType > * | cloneNonAD () const |
Public Member Functions inherited from casacore::Functional< Domain, Range > | |
| virtual | ~Functional () |
| Destructor. | |
| virtual Range | operator() (const Domain &x) const =0 |
Map a Domain x into a Range y value. | |
Protected Attributes | |
| std::shared_ptr< WrapperBase< T > > | doit_p |
| The function aid object. | |
Protected Attributes inherited from casacore::Function< T, U > | |
| 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. | |
Additional Inherited Members | |
Public Types inherited from casacore::Function< T, U > | |
| typedef FunctionTraits< T >::ArgType | ArgType |
| typedef const ArgType * | FunctionArg |
Construct nD function objects from C++ functions
Public interface
This class is provided so that user can quickly construct a function object from a C++ function pointer without having to write a function class. The constructor constructs a function object from a function pointer, and an optional parameter list. Parameters are necessary if the function has to be used in a functional fitting process (see GenericL2Fit).
The general function signature is f(x;p), where x represents the arguments, and p the parameters. The allowed signatures of the function include all combinations of arguments and parameters, and are:
f() no arguments e.g. random number or constant f(x) 1-dimensional, e.g. sin(x) f(Vectorx) n-dimensional, e.g. sin(x+2y) Definition at line 83 of file FunctionWrapper.h.
| casacore::FunctionWrapper< T >::FunctionWrapper | ( | ) |
Default constructor, to enable arrays.
| casacore::FunctionWrapper< T >::FunctionWrapper | ( | T(*)() | f | ) |
A function with no parameters and no arguments.
| casacore::FunctionWrapper< T >::FunctionWrapper | ( | T(*)(const T &) | f, |
| const Bool | isPar | ||
| ) |
A function with parameter and no arguments (Note value of isPar irrelevant)
| casacore::FunctionWrapper< T >::FunctionWrapper | ( | T(*)(const Vector< T > &) | f, |
| const Bool | isPar | ||
| ) |
A function with parameters and no arguments.
(Note value of isPar irrelevant)
| casacore::FunctionWrapper< T >::FunctionWrapper | ( | T(*)(const T &) | f | ) |
Construct a 1-dimensional function with no parameters.
| casacore::FunctionWrapper< T >::FunctionWrapper | ( | T(*)(const T &, const T &) | f, |
| const T & | par | ||
| ) |
Construct a 1-dimensional function with parameter.
| casacore::FunctionWrapper< T >::FunctionWrapper | ( | T(*)(const T &, const Vector< T > &) | f, |
| const Vector< T > & | par | ||
| ) |
Construct a 1-dimensional function with parameters.
| casacore::FunctionWrapper< T >::FunctionWrapper | ( | T(*)(const Vector< T > &) | f, |
| const Int | dim = 1 |
||
| ) |
Construct an n-dimensional function with no parameters.
| casacore::FunctionWrapper< T >::FunctionWrapper | ( | T(*)(const Vector< T > &, const T &) | f, |
| const T & | par, | ||
| const uInt | dim = 1 |
||
| ) |
Construct an n-dimensional function with parameter.
| casacore::FunctionWrapper< T >::FunctionWrapper | ( | T(*)(const Vector< T > &, const Vector< T > &) | f, |
| const Vector< T > & | par, | ||
| const uInt | dim = 1 |
||
| ) |
Construct an n-dimensional function with parameters.
| casacore::FunctionWrapper< T >::FunctionWrapper | ( | const FunctionWrapper< T > & | other | ) |
Copy constructor (reference semantics)
|
inlinevirtual |
Destructor.
Definition at line 120 of file FunctionWrapper.h.
|
inlinevirtual |
Return a copy of this object from the heap.
The caller is responsible for deleting this pointer.
Implements casacore::Function< T, U >.
Definition at line 134 of file FunctionWrapper.h.
|
virtual |
Evaluate the function at x.
|
virtual |
Get the dimensionality.
Implements casacore::Function< T, U >.
| FunctionWrapper< T > & casacore::FunctionWrapper< T >::operator= | ( | const FunctionWrapper< T > & | other | ) |
Copy assignment (reference semantics)
|
protected |
The function aid object.
Definition at line 141 of file FunctionWrapper.h.