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>
353 template<
class T,
class U>
354 ostream &operator<<(ostream &os, const Function<T,U> &fun);
358 template<
class T,
class U>
359 inline ostream &operator<<(ostream &os, const Function<T,U> &fun) {
360 return fun.print(os); }
364 #ifndef CASACORE_NO_AUTO_TEMPLATES
365 #include <casacore/scimath/Functionals/Function.tcc>
366 #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
A 1-D Specialization of the Array class.
FunctionParam< T > param_p
The parameters and masks.
virtual void setMode(const RecordInterface &mode)
get/set the function mode.
Map a domain object into a range object via operator().
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.
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.
T ArgType
Type for arguments.
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.
Function data types for parameters and arguments.
Function(const Function< T, U > &other)
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
#define casacore
<X11/Intrinsic.h> #defines true, false, casacore::Bool, and String.