Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROOT::Math::IGradientFunctionMultiDimTempl< T > Class Template Reference

template<class T>
class ROOT::Math::IGradientFunctionMultiDimTempl< T >

Interface (abstract class) for multi-dimensional functions providing a gradient calculation.

It implements both the ROOT::Math::IBaseFunctionMultiDimTempl and ROOT::Math::IGradientMultiDimTempl interfaces. 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.

Definition at line 342 of file IFunction.h.

Public Types

typedef IBaseFunctionMultiDimTempl< T > BaseFunc
 
typedef IGradientMultiDimTempl< T > BaseGrad
 
- Public Types inherited from ROOT::Math::IBaseFunctionMultiDimTempl< T >
typedef T BackendType
 
typedef IBaseFunctionMultiDimTempl< T > BaseFunc
 

Public Member Functions

virtual ~IGradientFunctionMultiDimTempl ()
 Virtual Destructor (no operations)
 
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.
 
virtual bool returnsInMinuit2ParameterSpace () const
 
- Public Member Functions inherited from ROOT::Math::IBaseFunctionMultiDimTempl< T >
 IBaseFunctionMultiDimTempl ()
 
virtual ~IBaseFunctionMultiDimTempl ()
 virtual destructor
 
virtual IBaseFunctionMultiDimTempl< T > * Clone () const =0
 Clone a function.
 
operator() (const T *x) const
 Evaluate the function at a point x[].
 
- Public Member Functions inherited from ROOT::Math::IGradientMultiDimTempl< T >
virtual ~IGradientMultiDimTempl ()
 virtual destructor
 
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.
 
Derivative (const T *x, unsigned int icoord=0) const
 Return the partial derivative with respect to the passed coordinate.
 

#include <Math/IFunction.h>

Inheritance diagram for ROOT::Math::IGradientFunctionMultiDimTempl< T >:
[legend]

Member Typedef Documentation

◆ BaseFunc

template<class T >
typedef IBaseFunctionMultiDimTempl<T> ROOT::Math::IGradientFunctionMultiDimTempl< T >::BaseFunc

Definition at line 346 of file IFunction.h.

◆ BaseGrad

template<class T >
typedef IGradientMultiDimTempl<T> ROOT::Math::IGradientFunctionMultiDimTempl< T >::BaseGrad

Definition at line 347 of file IFunction.h.

Constructor & Destructor Documentation

◆ ~IGradientFunctionMultiDimTempl()

template<class T >
virtual ROOT::Math::IGradientFunctionMultiDimTempl< T >::~IGradientFunctionMultiDimTempl ( )
inlinevirtual

Virtual Destructor (no operations)

Definition at line 352 of file IFunction.h.

Member Function Documentation

◆ FdF()

template<class T >
virtual void ROOT::Math::IGradientFunctionMultiDimTempl< T >::FdF ( const T *  x,
T &  f,
T *  df 
) const
inlinevirtual

Optimized method to evaluate at the same time the function value and derivative at a point x.

Often both value and derivatives are needed and it is often more efficient to compute them at the same time. Derived class should implement this method if performances play an important role and if it is faster to evaluate value and derivative at the same time

Implements ROOT::Math::IGradientMultiDimTempl< T >.

Definition at line 383 of file IFunction.h.

◆ Gradient()

template<class T >
virtual void ROOT::Math::IGradientFunctionMultiDimTempl< T >::Gradient ( const T *  x,
T *  grad 
) const
inlinevirtual

Evaluate all the vector of function derivatives (gradient) at a point x.

Derived classes must re-implement it if more efficient than evaluating one at a time

Implements ROOT::Math::IGradientMultiDimTempl< T >.

Definition at line 358 of file IFunction.h.

◆ GradientWithPrevResult()

template<class T >
virtual void ROOT::Math::IGradientFunctionMultiDimTempl< T >::GradientWithPrevResult ( const T *  x,
T *  grad,
T *  previous_grad,
T *  previous_g2,
T *  previous_gstep 
) const
inlinevirtual

In some cases, the gradient algorithm will use information from the previous step, these can be passed in with this overload.

The previous_* arrays can also be used to return second derivative and step size so that these can be passed forward again as well at the call site, if necessary.

Definition at line 368 of file IFunction.h.

◆ NDim()

template<class T >
virtual unsigned int ROOT::Math::IBaseFunctionMultiDimTempl< T >::NDim ( ) const
virtual

◆ returnsInMinuit2ParameterSpace()

template<class T >
virtual bool ROOT::Math::IGradientFunctionMultiDimTempl< T >::returnsInMinuit2ParameterSpace ( ) const
inlinevirtual

Reimplemented in RooFit::TestStatistics::MinuitFcnGrad.

Definition at line 389 of file IFunction.h.

  • math/mathcore/inc/Math/IFunction.h