Documentation for class Functor class.
It is used to wrap in a very simple and convenient way multi-dimensional function objects. It can wrap all the following types:
-
any C++ callable object implementation double operator()( const double * )
-
a free C function of type double ()(const double * )
-
an std::function of type std::function<double (double const *)>
-
a member function with the correct signature like Foo::Eval(const double * ). In this case one pass the object pointer and a pointer to the member function (&Foo::Eval)
The function dimension is required when constructing the functor.
Definition at line 47 of file Functor.h.
|
| Functor () |
| Default constructor.
|
|
template<class PtrObj , typename MemFn > |
| Functor (const PtrObj &p, MemFn memFn, unsigned int dim) |
| Construct from a pointer to member function (multi-dim type).
|
|
| Functor (std::function< double(double const *)> const &f, unsigned int dim) |
| Construct from a callable object of multi-dimension with the right signature (implementing double operator()(const double *x) ).
|
|
Functor * | Clone () const override |
| Clone a function.
|
|
unsigned int | NDim () const override |
| Retrieve the dimension of the function.
|
|
virtual | ~IBaseFunctionMultiDimTempl ()=default |
|
virtual bool | HasGradient () const |
|
double | operator() (const double *x) const |
| Evaluate the function at a point x[].
|
|