Logo ROOT  
Reference Guide
ROOT::Math::MultiNumGradFunction Class Reference

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

 MultiNumGradFunction (const IMultiGenFunction &f)
 Constructor from a IMultiGenFunction interface. More...
 
template<class FuncType >
 MultiNumGradFunction (FuncType f, int n)
 Constructor from a generic function (pointer or reference) and number of dimension implementiong operator () (double * x) More...
 
 ~MultiNumGradFunction ()
 Destructor (no operations) More...
 
IMultiGenFunctionClone () const
 Clone a function. More...
 
unsigned int NCalls () const
 
unsigned int NDim () const
 Retrieve the dimension of the function. More...
 
void SetOwnership (bool on=true)
 
- Public Member Functions inherited from ROOT::Math::IGradientFunctionMultiDimTempl< T >
virtual ~IGradientFunctionMultiDimTempl ()
 Virtual Destructor (no operations) More...
 
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. More...
 
virtual void Gradient (const T *x, T *grad) const
 Evaluate all the vector of function derivatives (gradient) at a point x. More...
 
virtual unsigned int NDim () const=0
 Retrieve the dimension of the function. More...
 
- Public Member Functions inherited from ROOT::Math::IBaseFunctionMultiDimTempl< T >
 IBaseFunctionMultiDimTempl ()
 
virtual ~IBaseFunctionMultiDimTempl ()
 virtual destructor More...
 
virtual IBaseFunctionMultiDimTempl< T > * Clone () const =0
 Clone a function. More...
 
virtual unsigned int NDim () const =0
 Retrieve the dimension of the function. More...
 
operator() (const T *x) const
 Evaluate the function at a point x[]. More...
 
- Public Member Functions inherited from ROOT::Math::IGradientMultiDimTempl< T >
virtual ~IGradientMultiDimTempl ()
 virual destructor More...
 
Derivative (const T *x, unsigned int icoord=0) const
 Return the partial derivative with respect to the passed coordinate. More...
 
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. More...
 
virtual void Gradient (const T *x, T *grad) const =0
 Evaluate all the vector of function derivatives (gradient) at a point x. More...
 

Static Public Member Functions

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

Private Member Functions

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

Private Attributes

unsigned int fDim
 
const IMultiGenFunctionfFunc
 
unsigned int fNCalls
 
bool fOwner
 

Static Private Attributes

static double fgEps = 0.001
 

Additional Inherited Members

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

#include <Math/MultiNumGradFunction.h>

Inheritance diagram for ROOT::Math::MultiNumGradFunction:
[legend]

Constructor & Destructor Documentation

◆ MultiNumGradFunction() [1/2]

ROOT::Math::MultiNumGradFunction::MultiNumGradFunction ( const IMultiGenFunction f)
inline

Constructor from a IMultiGenFunction interface.

Definition at line 57 of file MultiNumGradFunction.h.

◆ MultiNumGradFunction() [2/2]

template<class FuncType >
ROOT::Math::MultiNumGradFunction::MultiNumGradFunction ( FuncType  f,
int  n 
)
inline

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

Definition at line 70 of file MultiNumGradFunction.h.

◆ ~MultiNumGradFunction()

ROOT::Math::MultiNumGradFunction::~MultiNumGradFunction ( )
inline

Destructor (no operations)

Definition at line 82 of file MultiNumGradFunction.h.

Member Function Documentation

◆ Clone()

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

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
private

Definition at line 42 of file MultiNumGradFunction.cxx.

◆ DoEval()

double ROOT::Math::MultiNumGradFunction::DoEval ( const double x) const
inlineprivate

Definition at line 118 of file MultiNumGradFunction.h.

◆ GetDerivPrecision()

double ROOT::Math::MultiNumGradFunction::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
inlinevirtual

Retrieve the dimension of the function.

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

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.

Member Data Documentation

◆ fDim

unsigned int ROOT::Math::MultiNumGradFunction::fDim
private

Definition at line 128 of file MultiNumGradFunction.h.

◆ fFunc

const IMultiGenFunction* ROOT::Math::MultiNumGradFunction::fFunc
private

Definition at line 127 of file MultiNumGradFunction.h.

◆ fgEps

double ROOT::Math::MultiNumGradFunction::fgEps = 0.001
staticprivate

Definition at line 132 of file MultiNumGradFunction.h.

◆ fNCalls

unsigned int ROOT::Math::MultiNumGradFunction::fNCalls
mutableprivate

Definition at line 129 of file MultiNumGradFunction.h.

◆ fOwner

bool ROOT::Math::MultiNumGradFunction::fOwner
private

Definition at line 130 of file MultiNumGradFunction.h.


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