ROOT  6.06/09
Reference Guide
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
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 53 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...
 
unsigned int NDim () const
 Retrieve the dimension of the function. More...
 
unsigned int NCalls () const
 
IMultiGenFunctionClone () const
 Clone a function. More...
 
void SetOwnership (bool on=true)
 
- Public Member Functions inherited from ROOT::Math::IGradientFunctionMultiDim
virtual ~IGradientFunctionMultiDim ()
 Virtual Destructor (no operations) More...
 
virtual void Gradient (const double *x, double *grad) const
 Evaluate all the vector of function derivatives (gradient) at a point x. More...
 
virtual void FdF (const double *x, double &f, double *df) const
 Optimized method to evaluate at the same time the function value and derivative at a point x. More...
 
- Public Member Functions inherited from ROOT::Math::IBaseFunctionMultiDim
 IBaseFunctionMultiDim ()
 
virtual ~IBaseFunctionMultiDim ()
 virtual destructor More...
 
double operator() (const double *x) const
 Evaluate the function at a point x[]. More...
 
- Public Member Functions inherited from ROOT::Math::IGradientMultiDim
virtual ~IGradientMultiDim ()
 virual destructor More...
 
double Derivative (const double *x, unsigned int icoord=0) const
 Return the partial derivative with respect to the passed coordinate. More...
 

Static Public Member Functions

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

Private Member Functions

double DoEval (const double *x) const
 Implementation of the evaluation function. More...
 
double DoDerivative (const double *x, unsigned int icoord) const
 function to evaluate the derivative with respect each coordinate. More...
 

Private Attributes

const IMultiGenFunctionfFunc
 
unsigned int fDim
 
unsigned int fNCalls
 
bool fOwner
 

Static Private Attributes

static double fgEps = 0.001
 

Additional Inherited Members

- Public Types inherited from ROOT::Math::IGradientFunctionMultiDim
typedef IBaseFunctionMultiDim BaseFunc
 
typedef IGradientMultiDim BaseGrad
 
- Public Types inherited from ROOT::Math::IBaseFunctionMultiDim
typedef IBaseFunctionMultiDim BaseFunc
 

#include <Math/MultiNumGradFunction.h>

+ Inheritance diagram for ROOT::Math::MultiNumGradFunction:
+ Collaboration diagram for ROOT::Math::MultiNumGradFunction:

Constructor & Destructor Documentation

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

Constructor from a IMultiGenFunction interface.

Definition at line 61 of file MultiNumGradFunction.h.

Referenced by Clone().

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 74 of file MultiNumGradFunction.h.

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

Destructor (no operations)

Definition at line 86 of file MultiNumGradFunction.h.

Member Function Documentation

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

Clone a function.

Each derived class must implement their version of the Clone method

Implements ROOT::Math::IBaseFunctionMultiDim.

Definition at line 97 of file MultiNumGradFunction.h.

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

function to evaluate the derivative with respect each coordinate.

To be implemented by the derived class

Implements ROOT::Math::IGradientMultiDim.

Definition at line 44 of file MultiNumGradFunction.cxx.

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

Implementation of the evaluation function.

Must be implemented by derived classes

Implements ROOT::Math::IBaseFunctionMultiDim.

Definition at line 122 of file MultiNumGradFunction.h.

double ROOT::Math::MultiNumGradFunction::GetDerivPrecision ( )
static

get precision value used for calculating the derivative step-size

Definition at line 58 of file MultiNumGradFunction.cxx.

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

Retrieve the dimension of the function.

Implements ROOT::Math::IBaseFunctionMultiDim.

Definition at line 93 of file MultiNumGradFunction.h.

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 56 of file MultiNumGradFunction.cxx.

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

Definition at line 109 of file MultiNumGradFunction.h.

Referenced by ROOT::Math::GSLSimAnMinimizer::Minimize().

Member Data Documentation

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

Definition at line 132 of file MultiNumGradFunction.h.

Referenced by NDim().

const IMultiGenFunction* ROOT::Math::MultiNumGradFunction::fFunc
private
double ROOT::Math::MultiNumGradFunction::fgEps = 0.001
staticprivate

Definition at line 136 of file MultiNumGradFunction.h.

Referenced by DoDerivative(), GetDerivPrecision(), and SetDerivPrecision().

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

Definition at line 133 of file MultiNumGradFunction.h.

Referenced by DoEval(), and NCalls().

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

Definition at line 134 of file MultiNumGradFunction.h.

Referenced by Clone(), SetOwnership(), and ~MultiNumGradFunction().


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