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

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

Documentation for the abstract class IBaseFunctionMultiDim.

Interface (abstract class) for generic functions objects of multi-dimension Provides a method to evaluate the function given a vector of coordinate values, by implementing operator() (const double *). In addition it defines the interface for copying functions via the pure virtual method Clone() and the interface for getting the function dimension via the NDim() method. Derived classes must implement the pure private virtual method DoEval(const double *) for the function evaluation in addition to NDim() and Clone().

Note
ROOT::Math::Functor is the recommended way to use one's own function with the fitting framework.

Definition at line 63 of file IFunction.h.

Public Types

typedefBackendType
 
typedef IBaseFunctionMultiDimTempl< T > BaseFunc
 

Public Member Functions

virtual ~IBaseFunctionMultiDimTempl ()=default
 
virtual IBaseFunctionMultiDimTempl< T > * Clone () const =0
 Clone a function.
 
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
 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 bool HasGradient () const
 
virtual unsigned int NDim () const =0
 Retrieve the dimension of the function.
 
operator() (const T *x) const
 Evaluate the function at a point x[].
 
virtual bool returnsInMinuit2ParameterSpace () const
 

Private Member Functions

virtualDoDerivative (const T *, unsigned int) const
 Function to evaluate the derivative with respect each coordinate. To be implemented by the derived class.
 
virtualDoDerivativeWithPrevResult (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.
 
virtualDoEval (const T *x) const =0
 Implementation of the evaluation function. Must be implemented by derived classes.
 

#include <Math/IFunction.h>

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

Member Typedef Documentation

◆ BackendType

template<class T >
typedef T ROOT::Math::IBaseFunctionMultiDimTempl< T >::BackendType

Definition at line 67 of file IFunction.h.

◆ BaseFunc

Definition at line 68 of file IFunction.h.

Constructor & Destructor Documentation

◆ ~IBaseFunctionMultiDimTempl()

Member Function Documentation

◆ Clone()

◆ Derivative() [1/2]

template<class T >
T ROOT::Math::IBaseFunctionMultiDimTempl< 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 133 of file IFunction.h.

◆ Derivative() [2/2]

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

Return the partial derivative with respect to the passed coordinate.

Definition at line 128 of file IFunction.h.

◆ DoDerivative()

template<class T >
virtual T ROOT::Math::IBaseFunctionMultiDimTempl< T >::DoDerivative ( const T * ,
unsigned int  ) const
inlineprivatevirtual

Function to evaluate the derivative with respect each coordinate. To be implemented by the derived class.

Definition at line 144 of file IFunction.h.

◆ DoDerivativeWithPrevResult()

template<class T >
virtual T ROOT::Math::IBaseFunctionMultiDimTempl< 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 149 of file IFunction.h.

◆ DoEval()

template<class T >
virtual T ROOT::Math::IBaseFunctionMultiDimTempl< T >::DoEval ( const T * x) const
privatepure virtual

Implementation of the evaluation function. Must be implemented by derived classes.

Implemented in ROOT::Math::Functor, ROOT::Math::WrappedMultiTF1Templ< T >, ROOT::Math::IParametricFunctionMultiDimTempl< T >, and ROOT::Math::IParametricGradFunctionMultiDimTempl< T >.

◆ FdF()

template<class T >
virtual void ROOT::Math::IBaseFunctionMultiDimTempl< 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

Definition at line 121 of file IFunction.h.

◆ Gradient()

template<class T >
virtual void ROOT::Math::IBaseFunctionMultiDimTempl< 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

Definition at line 98 of file IFunction.h.

◆ GradientWithPrevResult()

template<class T >
virtual void ROOT::Math::IBaseFunctionMultiDimTempl< 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 109 of file IFunction.h.

◆ HasGradient()

template<class T >
virtual bool ROOT::Math::IBaseFunctionMultiDimTempl< T >::HasGradient ( ) const
inlinevirtual

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

Definition at line 92 of file IFunction.h.

◆ NDim()

◆ operator()()

template<class T >
T ROOT::Math::IBaseFunctionMultiDimTempl< T >::operator() ( const T * x) const
inline

Evaluate the function at a point x[].

Use the pure virtual private method DoEval which must be implemented by the sub-classes.

Definition at line 81 of file IFunction.h.

◆ returnsInMinuit2ParameterSpace()

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

Definition at line 94 of file IFunction.h.


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