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:
The function dimension is required when constructing the functor.
Public Member Functions | |
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 |
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. | |
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 | GradientWithPrevResult (const double *x, double *grad, double *previous_grad, double *previous_g2, double *previous_gstep) const |
In some cases, the gradient algorithm will use information from the previous step, these can be passed in with this overload. | |
virtual bool | HasGradient () const |
double | operator() (const double *x) const |
Evaluate the function at a point x[]. | |
virtual bool | returnsInMinuit2ParameterSpace () const |
Private Member Functions | |
double | DoEval (const double *x) const override |
Implementation of the evaluation function. Must be implemented by derived classes. | |
Private Attributes | |
unsigned int | fDim |
std::function< double(double const *) | fFunc ) |
Additional Inherited Members | |
![]() | |
typedef double | BackendType |
typedef IBaseFunctionMultiDimTempl< double > | BaseFunc |
#include <Math/Functor.h>
|
inline |
|
inlineoverridevirtual |
Clone a function.
Each derived class must implement their version of the Clone method.
Implements ROOT::Math::IBaseFunctionMultiDimTempl< double >.
Implementation of the evaluation function. Must be implemented by derived classes.
Implements ROOT::Math::IBaseFunctionMultiDimTempl< double >.
|
inlineoverridevirtual |
Retrieve the dimension of the function.
Implements ROOT::Math::IBaseFunctionMultiDimTempl< double >.