Interface (abstract class) for multi-dimensional functions providing a gradient calculation.
The method ROOT::Math::IFunction::Gradient calculates the full gradient vector, ROOT::Math::IFunction::Derivative calculates the partial derivative for each coordinate and ROOT::Math::Fdf calculates the gradient and the function value at the same time. The pure private virtual method DoDerivative() must be implemented by the derived classes, while Gradient and FdF are by default implemented using DoDerivative, butthey can be overloaded by the derived classes to improve the efficiency in the derivative calculation.
Gradient interface (abstract class) defining the signature for calculating the gradient of a multi-dimensional function. Three methods are provided:
Definition at line 252 of file IFunction.h.
Public Member Functions | |
bool | HasGradient () const override |
![]() | |
virtual | ~IBaseFunctionMultiDimTempl ()=default |
virtual IBaseFunctionMultiDimTempl< T > * | Clone () const =0 |
Clone a function. | |
T | Derivative (const T *x, unsigned int icoord, T *previous_grad, T *previous_g2, T *previous_gstep) const |
In some cases, the derivative algorithm will use information from the previous step, these can be passed in with this overload. | |
T | Derivative (const T *x, unsigned int icoord=0) const |
Return the partial derivative with respect to the passed coordinate. | |
virtual void | FdF (const T *x, T &f, T *df) const |
Optimized method to evaluate at the same time the function value and derivative at a point x. | |
virtual void | Gradient (const T *x, T *grad) const |
Evaluate all the vector of function derivatives (gradient) at a point x. | |
virtual void | GradientWithPrevResult (const T *x, T *grad, T *previous_grad, T *previous_g2, T *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 unsigned int | NDim () const =0 |
Retrieve the dimension of the function. | |
T | operator() (const T *x) const |
Evaluate the function at a point x[]. | |
virtual bool | returnsInMinuit2ParameterSpace () const |
Additional Inherited Members | |
![]() | |
typedef T | BackendType |
typedef IBaseFunctionMultiDimTempl< T > | BaseFunc |
#include <Math/IFunction.h>
|
inlineoverridevirtual |
Reimplemented from ROOT::Math::IBaseFunctionMultiDimTempl< T >.
Definition at line 256 of file IFunction.h.