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 49 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 | ~IBaseFunctionMultiDimTempl ()=default |
| |
| double | Derivative (const double *x, unsigned int icoord, double *previous_grad, double *previous_g2, double *previous_gstep) const |
| | In some cases, the derivative algorithm will use information from the previous step, these can be passed in with this overload.
|
| |
| double | Derivative (const double *x, unsigned int icoord, double *previous_grad, double *previous_g2, double *previous_gstep) const |
| | In some cases, the derivative algorithm will use information from the previous step, these can be passed in with this overload.
|
| |
| double | Derivative (const double *x, unsigned int icoord=0) const |
| | Return the partial derivative with respect to the passed coordinate.
|
| |
| double | Derivative (const double *x, unsigned int icoord=0) const |
| | Return the partial derivative with respect to the passed coordinate.
|
| |
| virtual void | FdF (const double *x, double &f, double *df) const |
| | Optimized method to evaluate at the same time the function value and derivative at a point x.
|
| |
| virtual void | FdF (const double *x, double &f, double *df) const |
| | Optimized method to evaluate at the same time the function value and derivative at a point x.
|
| |
| virtual void | Gradient (const double *x, double *grad) const |
| | Evaluate all the vector of function derivatives (gradient) at a point x.
|
| |
| virtual void | Gradient (const double *x, double *grad) const |
| | Evaluate all the vector of function derivatives (gradient) at a point x.
|
| |
| virtual bool | HasGradient () const |
| |
| virtual bool | HasGradient () const |
| |
| double | operator() (const double *x) const |
| | Evaluate the function at a point x[].
|
| |
| double | operator() (const double *x) const |
| | Evaluate the function at a point x[].
|
| |