WrapperBase.h
Classes
- WrapperBase -- Aid in constructing function objects from C++ functions (full description)
template<class T> class WrapperBase
Interface
- Public Members
- WrapperBase() : ndim_p(0), arg_p(0)
- explicit WrapperBase(const uInt dim) : ndim_p(dim), arg_p(dim)
- virtual ~WrapperBase()
- virtual T eval(typename Function<T>::FunctionArg x, const typename<T> &par) const = 0
- virtual uInt ndim() const
- Private Members
- WrapperBase(const WrapperBase<T> &other)
- WrapperBase<T> &operator=(const WrapperBase<T> &other)
Prerequisite
Synopsis
This base class is provided to enable compile time selection of the
appropriate function call through WrapperData.
Example
Float func(const Vector<Float>& x) { return x(0)*x(1); } // x*y
// Convert C++ functions to Functionals
FunctionWrapper<Float> Func(func, 2);
Member Description
WrapperBase() : ndim_p(0), arg_p(0)
Default constructor: zero dimension
explicit WrapperBase(const uInt dim) : ndim_p(dim), arg_p(dim)
Standard constructor
Destructor
virtual T eval(typename Function<T>::FunctionArg x, const typename<T> &par) const = 0
Evaluate the function at x.
virtual uInt ndim() const
Get the dimensionality
WrapperBase(const WrapperBase<T> &other)
WrapperBase<T> &operator=(const WrapperBase<T> &other)
Copy constructor and assignment (not implemented)