ROOT   Reference Guide
Searching...
No Matches

MultiNumGradFunction class to wrap a normal function in a gradient function using numerical gradient calculation provided by the class Derivator (based on GSL numerical derivation)

Definition at line 49 of file MultiNumGradFunction.h.

## Public Member Functions

Constructor from a IMultiGenFunction interface.

template<class FuncType >
Constructor from a generic function (pointer or reference) and number of dimension implementing operator () (double * x)

Destructor (no operations)

IMultiGenFunctionClone () const override
Clone a function.

unsigned int NCalls () const

unsigned int NDim () const override
Retrieve the dimension of the function.

void SetOwnership (bool on=true)

Public Member Functions inherited from ROOT::Math::IGradientFunctionMultiDimTempl< 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.

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.

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

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

virtual bool returnsInMinuit2ParameterSpace () const

Public Member Functions inherited from ROOT::Math::IBaseFunctionMultiDimTempl< T >
virtual ~IBaseFunctionMultiDimTempl ()=default

operator() (const T *x) const
Evaluate the function at a point x[].

## Static Public Member Functions

static double GetDerivPrecision ()
get precision value used for calculating the derivative step-size

static void SetDerivPrecision (double eps)
precision value used for calculating the derivative step-size h = eps * |x|.

## Private Member Functions

double DoDerivative (const double *x, unsigned int icoord) const override

double DoEval (const double *x) const override

## Private Attributes

unsigned int fDim

const IMultiGenFunctionfFunc

unsigned int fNCalls

bool fOwner

## Static Private Attributes

static double fgEps = 0.001

Public Types inherited from ROOT::Math::IGradientFunctionMultiDimTempl< T >
typedef IBaseFunctionMultiDimTempl< T > BaseFunc

Public Types inherited from ROOT::Math::IBaseFunctionMultiDimTempl< T >
typedef T BackendType

typedef IBaseFunctionMultiDimTempl< T > BaseFunc

#include <Math/MultiNumGradFunction.h>

[legend]

## Constructor & Destructor Documentation

inline

Constructor from a IMultiGenFunction interface.

Definition at line 57 of file MultiNumGradFunction.h.

template<class FuncType >
inline

Constructor from a generic function (pointer or reference) and number of dimension implementing operator () (double * x)

Definition at line 70 of file MultiNumGradFunction.h.

inlineoverride

Destructor (no operations)

Definition at line 82 of file MultiNumGradFunction.h.

## ◆ Clone()

 IMultiGenFunction * ROOT::Math::MultiNumGradFunction::Clone ( ) const
inlineoverridevirtual

Clone a function.

Each derived class must implement their version of the Clone method.

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

Definition at line 93 of file MultiNumGradFunction.h.

## ◆ DoDerivative()

 double ROOT::Math::MultiNumGradFunction::DoDerivative ( const double * x, unsigned int icoord ) const
overrideprivate

Definition at line 42 of file MultiNumGradFunction.cxx.

## ◆ DoEval()

 double ROOT::Math::MultiNumGradFunction::DoEval ( const double * x ) const
inlineoverrideprivate

Definition at line 118 of file MultiNumGradFunction.h.

## ◆ GetDerivPrecision()

static

get precision value used for calculating the derivative step-size

Definition at line 56 of file MultiNumGradFunction.cxx.

## ◆ NCalls()

 unsigned int ROOT::Math::MultiNumGradFunction::NCalls ( ) const
inline

Definition at line 91 of file MultiNumGradFunction.h.

## ◆ NDim()

 unsigned int ROOT::Math::MultiNumGradFunction::NDim ( ) const
inlineoverridevirtual

Retrieve the dimension of the function.

Definition at line 89 of file MultiNumGradFunction.h.

## ◆ SetDerivPrecision()

 void ROOT::Math::MultiNumGradFunction::SetDerivPrecision ( double eps )
static

precision value used for calculating the derivative step-size h = eps * |x|.

The default is 0.001, give a smaller in case function chanes rapidly

Definition at line 54 of file MultiNumGradFunction.cxx.

## ◆ SetOwnership()

 void ROOT::Math::MultiNumGradFunction::SetOwnership ( bool on = true )
inline

Definition at line 105 of file MultiNumGradFunction.h.

## ◆ fDim

private

Definition at line 128 of file MultiNumGradFunction.h.

## ◆ fFunc

private

Definition at line 127 of file MultiNumGradFunction.h.

## ◆ fgEps

staticprivate

Definition at line 132 of file MultiNumGradFunction.h.