28 #ifndef SCIMATH_FUNCTION_H 29 #define SCIMATH_FUNCTION_H 32 #include <casacore/casa/aips.h> 33 #include <casacore/casa/Arrays/Vector.h> 34 #include <casacore/casa/BasicMath/Functional.h> 35 #include <casacore/casa/Utilities/Assert.h> 36 #include <casacore/scimath/Functionals/FunctionParam.h> 37 #include <casacore/scimath/Functionals/FunctionTraits.h> 40 #include <casacore/casa/iosfwd.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>
241 virtual U
eval(FunctionArg x)
const = 0;
260 virtual U
operator()(
const ArgType &x,
const ArgType &y)
const;
261 virtual U
operator()(
const ArgType &x,
const ArgType &y,
262 const ArgType &z)
const;
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
Vector< ArgType > arg_p
Aid for non-contiguous argument storage.
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().
const FunctionParam< T > & parameters() const
Return the parameter interface.
const T & operator[](const uInt n) const
Bool parset_p
Indicate parameter written.
virtual void getMode(RecordInterface &mode) const
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.
uInt nparameters() const
Returns the number of parameters.
Function(const Function< W, X > &other)
const ArgType * FunctionArg
Container of function parameters with masking flags.
virtual U operator()(const ArgType &x) const
virtual Function< typename FunctionTraits< T >::BaseType > * cloneNonAD() const
Function(const Vector< T > &in)
Numerical functional interface class.
const Vector< ArgType > & argp() const
Get arg_p and parset_p.
#define DebugAssert(expr, exception)
virtual U operator()(FunctionArg x) const
bool Bool
Define the standard types used by Casacore.
Bool locked_p
Indicate that parameters are expected to be locked from changing.
virtual Function< typename FunctionTraits< T >::DiffType > * cloneAD() const
virtual Bool hasMode() const
return True if the implementing function supports a mode.
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 Bool & mask(const uInt n) const
virtual const String & name() const
Specify the name associated with the function (default will be unknown)
virtual U operator()() const
Evaluate this function object at xor at x, y.
Base class for all Casacore library errors.
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 U eval(FunctionArg x) const =0
Evaluate the function object.
ostream & print(ostream &os) const
Print the function (i.e.
this file contains all the compiler specific defines