28 #ifndef SCIMATH_FUNCTION_H
29 #define SCIMATH_FUNCTION_H
46 class RecordInterface;
200 template<
class T,
class U=T>
class Function :
201 public Functional<typename FunctionTraits<T>::ArgType, U>,
202 public Functional<Vector<typename FunctionTraits<T>::ArgType>, U> {
219 template <
class W,
class X>
345 template<
class T,
class U>
346 ostream &operator<<(ostream &os, const Function<T,U> &fun);
350 template<
class T,
class U>
351 inline ostream &operator<<(ostream &os, const Function<T,U> &fun) {
352 return fun.print(os); }
356 #ifndef CASACORE_NO_AUTO_TEMPLATES
357 #include <casacore/scimath/Functionals/Function.tcc>
358 #endif //# CASACORE_NO_AUTO_TEMPLATES
uInt nparameters() const
Returns the number of parameters.
virtual U operator()(const ArgType &x) const
Vector< ArgType > arg_p
Aid for non-contiguous argument storage.
const Bool & mask(const uInt n) const
FunctionParam< T > param_p
The parameters and masks.
virtual void setMode(const RecordInterface &mode)
get/set the function mode.
virtual const String & name() const
Specify the name associated with the function (default will be unknown)
Bool parset_p
Indicate parameter written.
virtual U operator()() const
Evaluate this function object at xor at x, y.
virtual void getMode(RecordInterface &mode) const
const Vector< ArgType > & argp() const
Get arg_p and parset_p.
virtual uInt ndim() const =0
Returns the number of dimensions of function.
FunctionParam< T > & parameters()
FunctionTraits< T >::ArgType ArgType
T & operator[](const uInt n)
Manipulate the nth parameter (0-based) with no index check.
Function(const Function< W, X > &other)
const ArgType * FunctionArg
Container of function parameters with masking flags.
virtual Function< typename FunctionTraits< T >::DiffType > * cloneAD() const
Function(const Vector< T > &in)
Numerical functional interface class.
#define DebugAssert(expr, exception)
bool Bool
Define the standard types used by Casacore.
Class that computes partial derivatives by automatic differentiation.
Bool locked_p
Indicate that parameters are expected to be locked from changing.
Function(const FunctionParam< T > &other)
void lockParam()
Compiler cannot always find the correct 'const' version of parameter access.
Bool & mask(const uInt n)
Manipulate the mask associated with the nth parameter (e.g.
virtual ~Function()
Destructor.
const FunctionParam< T > & parameters() const
Return the parameter interface.
virtual U operator()(FunctionArg x) const
Base class for all Casacore library errors.
ostream & print(ostream &os) const
Print the function (i.e.
String: the storage and methods of handling collections of characters.
Abstract base class for Record classes.
virtual Function< T, U > * clone() const =0
Return a copy of this object from the heap.
virtual Bool hasMode() const
return True if the implementing function supports a mode.
const T & operator[](const uInt n) const
virtual U eval(FunctionArg x) const =0
Evaluate the function object.
virtual Function< typename FunctionTraits< T >::BaseType > * cloneNonAD() const