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

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

Gradient interface (abstract class) defining the signature for calculating the gradient of a multi-dimensional function.

Three methods are provided:

  • Gradient(const double *x, double * grad) evaluate the full gradient vector at the vector value x
  • Derivative(const double * x, int icoord) evaluate the partial derivative for the icoord coordinate
  • FdF(const double *x, double &f, double * g) evaluate at the same time gradient and function/

Concrete classes should derive from ROOT::Math::IGradientFunctionMultiDim and not from this class.

Definition at line 201 of file IFunction.h.

Public Member Functions

virtual ~IGradientMultiDimTempl ()
 virual 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.
 
virtual void FdF (const T *x, T &f, T *df) const =0
 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 =0
 Evaluate all the vector of function derivatives (gradient) at a point x.
 

Private Member Functions

virtual T DoDerivative (const T *x, unsigned int icoord) const =0
 function to evaluate the derivative with respect each coordinate.
 
virtual T DoDerivativeWithPrevResult (const T *x, unsigned int icoord, T *, T *, T *) const
 In some cases, the derivative algorithm will use information from the previous step, these can be passed in with this overload.
 

#include <Math/IFunction.h>

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

Constructor & Destructor Documentation

◆ ~IGradientMultiDimTempl()

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

virual destructor

Definition at line 206 of file IFunction.h.

Member Function Documentation

◆ Derivative() [1/2]

template<class T >
T ROOT::Math::IGradientMultiDimTempl< T >::Derivative ( const T *  x,
unsigned int  icoord,
T *  previous_grad,
T *  previous_g2,
T *  previous_gstep 
) const
inline

In some cases, the derivative 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 221 of file IFunction.h.

◆ Derivative() [2/2]

template<class T >
T ROOT::Math::IGradientMultiDimTempl< T >::Derivative ( const T *  x,
unsigned int  icoord = 0 
) const
inline

Return the partial derivative with respect to the passed coordinate.

Definition at line 217 of file IFunction.h.

◆ DoDerivative()

template<class T >
virtual T ROOT::Math::IGradientMultiDimTempl< T >::DoDerivative ( const T *  x,
unsigned int  icoord 
) const
privatepure virtual

function to evaluate the derivative with respect each coordinate.

To be implemented by the derived class

◆ DoDerivativeWithPrevResult()

template<class T >
virtual T ROOT::Math::IGradientMultiDimTempl< T >::DoDerivativeWithPrevResult ( const T *  x,
unsigned int  icoord,
T *  ,
T *  ,
T *   
) const
inlineprivatevirtual

In some cases, the derivative 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 246 of file IFunction.h.

◆ FdF()

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

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

Implemented in ROOT::Math::IGradientFunctionMultiDimTempl< T >.

◆ Gradient()

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

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

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

Implemented in ROOT::Math::IGradientFunctionMultiDimTempl< T >.


The documentation for this class was generated from the following file: