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

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

Interface (abstract class) for parametric gradient multi-dimensional functions providing in addition to function evaluation with respect to the coordinates also the gradient with respect to the parameters, via the method ParameterGradient.

It is a derived class from ROOT::Math::IParametricFunctionMultiDim.

The pure private virtual method DoParameterGradient must be implemented by the derived classes in addition to those inherited by the base abstract classes.

Definition at line 227 of file IParamFunction.h.

Public Types

typedef T BackendType
using BaseFunc = typename IParametricFunctionMultiDimTempl<T>::BaseFunc
using BaseGradFunc = IGradientFunctionMultiDimTempl<T>
using BaseParamFunc = IParametricFunctionMultiDimTempl<T>

Public Member Functions

 ~IParametricGradFunctionMultiDimTempl () override
 Virtual Destructor (no operations).
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 bool HasGradient () const
virtual bool HasParameterHessian () const
virtual unsigned int NDim () const =0
 Retrieve the dimension of the function.
virtual unsigned int NPar () const =0
 Return the number of Parameters.
operator() (const T *x) const
operator() (const T *x, const double *p) const
ParameterDerivative (const T *x, const double *p, unsigned int ipar=0) const
 Evaluate the partial derivative w.r.t a parameter ipar from values and parameters.
ParameterDerivative (const T *x, unsigned int ipar=0) const
 Evaluate partial derivative using cached parameter values.
virtual bool ParameterG2 (const T *, const double *, T *) const
 Evaluate all the second derivatives (diagonal ones) of the function with respect to the parameters at a point x.
virtual void ParameterGradient (const T *x, const double *p, T *grad) const
 Evaluate the all the derivatives (gradient vector) of the function with respect to the parameters at a point x.
void ParameterGradient (const T *x, T *grad) const
 Evaluate all derivatives using cached parameter values.
virtual bool ParameterHessian (const T *, const double *, T *) const
 Evaluate the all the Hessian (second derivatives matrix) of the function with respect to the parameters at a point x.
virtual std::string ParameterName (unsigned int i) const
 Return the name of the i-th parameter (starting from zero) Overwrite if want to avoid the default name ("Par_0, Par_1, ...").
virtual const doubleParameters () const =0
 Access the parameter values.
virtual void SetParameters (const double *p)=0
 Set the parameter values.

Private Member Functions

DoEval (const T *x) const override
 Implement the ROOT::Math::IBaseFunctionMultiDim interface DoEval(x) using the cached parameter values.
DoEvalPar (const T *x, const double *p) const override=0
 Implementation of the evaluation function using the x values and the parameters.
virtual T DoParameterDerivative (const T *x, const double *p, unsigned int ipar) const =0
 Evaluate the partial derivative w.r.t a parameter ipar , to be implemented by the derived classes.

#include <Math/IParamFunction.h>

Inheritance diagram for ROOT::Math::IParametricGradFunctionMultiDimTempl< T >:
ROOT::Math::IParametricFunctionMultiDimTempl< T > ROOT::Math::IBaseParam ROOT::Math::IBaseFunctionMultiDimTempl< T > ROOT::Math::IBaseParam ROOT::Math::WrappedMultiTF1Templ< T >

Member Typedef Documentation

◆ BackendType

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

Definition at line 67 of file IFunction.h.

◆ BaseFunc

template<class T>
using ROOT::Math::IParametricGradFunctionMultiDimTempl< T >::BaseFunc = typename IParametricFunctionMultiDimTempl<T>::BaseFunc

Definition at line 232 of file IParamFunction.h.

◆ BaseGradFunc

Definition at line 231 of file IParamFunction.h.

◆ BaseParamFunc

Definition at line 230 of file IParamFunction.h.

Constructor & Destructor Documentation

◆ ~IParametricGradFunctionMultiDimTempl()

Virtual Destructor (no operations).

Definition at line 238 of file IParamFunction.h.

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
inlineinherited

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 120 of file IFunction.h.

◆ Derivative() [2/2]

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

Return the partial derivative with respect to the passed coordinate.

Definition at line 115 of file IFunction.h.

◆ DoEval()

template<class T>
T ROOT::Math::IParametricGradFunctionMultiDimTempl< T >::DoEval ( const T * x) const
inlineoverrideprivatevirtual

Implement the ROOT::Math::IBaseFunctionMultiDim interface DoEval(x) using the cached parameter values.

Reimplemented from ROOT::Math::IParametricFunctionMultiDimTempl< T >.

Reimplemented in ROOT::Math::WrappedMultiTF1Templ< T >, and ROOT::Math::WrappedMultiTF1Templ< double >.

Definition at line 307 of file IParamFunction.h.

◆ DoEvalPar()

template<class T>
T ROOT::Math::IParametricGradFunctionMultiDimTempl< T >::DoEvalPar ( const T * x,
const double * p ) const
overrideprivatepure virtual

Implementation of the evaluation function using the x values and the parameters.

Must be implemented by derived classes

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

Implemented in ROOT::Math::MultiDimParamGradFunctionAdapter, ROOT::Math::WrappedMultiTF1Templ< T >, and ROOT::Math::WrappedMultiTF1Templ< double >.

◆ DoParameterDerivative()

template<class T>
virtual T ROOT::Math::IParametricGradFunctionMultiDimTempl< T >::DoParameterDerivative ( const T * x,
const double * p,
unsigned int ipar ) const
privatepure virtual

Evaluate the partial derivative w.r.t a parameter ipar , to be implemented by the derived classes.

Implemented in ROOT::Math::MultiDimParamGradFunctionAdapter, ROOT::Math::WrappedMultiTF1Templ< T >, and ROOT::Math::WrappedMultiTF1Templ< double >.

◆ FdF()

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

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

Reimplemented in ROOT::Math::LSResidualFunc< Func >.

Definition at line 108 of file IFunction.h.

◆ Gradient()

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

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

Reimplemented in ROOT::Math::GradFunctor, and ROOT::Math::LSResidualFunc< Func >.

Definition at line 96 of file IFunction.h.

◆ HasGradient()

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

◆ HasParameterHessian()

template<class T>
virtual bool ROOT::Math::IParametricGradFunctionMultiDimTempl< T >::HasParameterHessian ( ) const
inlinevirtual

◆ NDim()

◆ NPar()

◆ operator()() [1/2]

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

Definition at line 248 of file IParamFunction.h.

◆ operator()() [2/2]

template<class T>
T ROOT::Math::IParametricGradFunctionMultiDimTempl< T >::operator() ( const T * x,
const double * p ) const
inline

Definition at line 243 of file IParamFunction.h.

◆ ParameterDerivative() [1/2]

template<class T>
T ROOT::Math::IParametricGradFunctionMultiDimTempl< T >::ParameterDerivative ( const T * x,
const double * p,
unsigned int ipar = 0 ) const
inline

Evaluate the partial derivative w.r.t a parameter ipar from values and parameters.

Definition at line 283 of file IParamFunction.h.

◆ ParameterDerivative() [2/2]

template<class T>
T ROOT::Math::IParametricGradFunctionMultiDimTempl< T >::ParameterDerivative ( const T * x,
unsigned int ipar = 0 ) const
inline

Evaluate partial derivative using cached parameter values.

Definition at line 295 of file IParamFunction.h.

◆ ParameterG2()

template<class T>
virtual bool ROOT::Math::IParametricGradFunctionMultiDimTempl< T >::ParameterG2 ( const T * ,
const double * ,
T *  ) const
inlinevirtual

Evaluate all the second derivatives (diagonal ones) of the function with respect to the parameters at a point x.

g2 is a vector of dimension npar

Reimplemented in ROOT::Math::WrappedMultiTF1Templ< T >, and ROOT::Math::WrappedMultiTF1Templ< double >.

Definition at line 278 of file IParamFunction.h.

◆ ParameterGradient() [1/2]

template<class T>
virtual void ROOT::Math::IParametricGradFunctionMultiDimTempl< T >::ParameterGradient ( const T * x,
const double * p,
T * grad ) const
inlinevirtual

Evaluate the all the derivatives (gradient vector) of the function with respect to the parameters at a point x.

It is optional to be implemented by the derived classes for better efficiency

Reimplemented in ROOT::Math::MultiDimParamGradFunctionAdapter, ROOT::Math::WrappedMultiTF1Templ< T >, and ROOT::Math::WrappedMultiTF1Templ< double >.

Definition at line 257 of file IParamFunction.h.

◆ ParameterGradient() [2/2]

template<class T>
void ROOT::Math::IParametricGradFunctionMultiDimTempl< T >::ParameterGradient ( const T * x,
T * grad ) const
inline

Evaluate all derivatives using cached parameter values.

Definition at line 291 of file IParamFunction.h.

◆ ParameterHessian()

template<class T>
virtual bool ROOT::Math::IParametricGradFunctionMultiDimTempl< T >::ParameterHessian ( const T * ,
const double * ,
T *  ) const
inlinevirtual

Evaluate the all the Hessian (second derivatives matrix) of the function with respect to the parameters at a point x.

It is optional to be implemented by the derived classes if needed. If it is not implemented return a false. h must be dimensioned as a n x (n+1)/2 matrix (since it is a symmetric matrix)

Reimplemented in ROOT::Math::WrappedMultiTF1Templ< T >, and ROOT::Math::WrappedMultiTF1Templ< double >.

Definition at line 272 of file IParamFunction.h.

◆ ParameterName()

virtual std::string ROOT::Math::IBaseParam::ParameterName ( unsigned int i) const
inlinevirtualinherited

Return the name of the i-th parameter (starting from zero) Overwrite if want to avoid the default name ("Par_0, Par_1, ...").

Reimplemented in ROOT::Math::VavilovAccurateCdf, ROOT::Math::VavilovAccuratePdf, ROOT::Math::VavilovAccurateQuantile, ROOT::Math::WrappedMultiTF1Templ< T >, ROOT::Math::WrappedMultiTF1Templ< double >, and ROOT::Math::WrappedTF1.

Definition at line 86 of file IParamFunction.h.

◆ Parameters()

◆ SetParameters()

virtual void ROOT::Math::IBaseParam::SetParameters ( const double * p)
pure virtualinherited

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