ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes | List of all members
ROOT::Math::LSResidualFunc Class Reference

LSResidualFunc class description.

Internal class used for accessing the residuals of the Least Square function and their derivates which are estimated numerically using GSL numerical derivation. The class contains a pointer to the fit method function and an index specifying the i-th residual and wraps it in a multi-dim gradient function interface ROOT::Math::IGradientFunctionMultiDim. The class is used by ROOT::Math::GSLNLSMinimizer (GSL non linear least square fitter)

Definition at line 77 of file GSLNLSMinimizer.h.

Public Member Functions

 LSResidualFunc ()
 
 LSResidualFunc (const ROOT::Math::FitMethodFunction &func, unsigned int i)
 
 LSResidualFunc (const LSResidualFunc &rhs)
 
LSResidualFuncoperator= (const LSResidualFunc &rhs)
 
IMultiGenFunctionClone () const
 Clone a function. More...
 
unsigned int NDim () const
 Retrieve the dimension of the function. More...
 
void Gradient (const double *x, double *g) const
 Evaluate all the vector of function derivatives (gradient) at a point x. More...
 
void FdF (const double *x, double &f, double *g) 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::IGradientFunctionMultiDim
virtual ~IGradientFunctionMultiDim ()
 Virtual Destructor (no operations) 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...
 

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

unsigned int fIndex
 
const
ROOT::Math::FitMethodFunction
fChi2
 
std::vector< doublefX2
 

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/GSLNLSMinimizer.h>

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

Constructor & Destructor Documentation

ROOT::Math::LSResidualFunc::LSResidualFunc ( )
inline

Definition at line 81 of file GSLNLSMinimizer.h.

Referenced by Clone().

ROOT::Math::LSResidualFunc::LSResidualFunc ( const ROOT::Math::FitMethodFunction func,
unsigned int  i 
)
inline

Definition at line 85 of file GSLNLSMinimizer.h.

ROOT::Math::LSResidualFunc::LSResidualFunc ( const LSResidualFunc rhs)
inline

Definition at line 93 of file GSLNLSMinimizer.h.

Member Function Documentation

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

Clone a function.

Each derived class must implement their version of the Clone method

Implements ROOT::Math::IBaseFunctionMultiDim.

Definition at line 109 of file GSLNLSMinimizer.h.

double ROOT::Math::LSResidualFunc::DoDerivative ( const double x,
unsigned int  icoord 
) const
inlineprivatevirtual

function to evaluate the derivative with respect each coordinate.

To be implemented by the derived class

Implements ROOT::Math::IGradientMultiDim.

Definition at line 139 of file GSLNLSMinimizer.h.

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

Implementation of the evaluation function.

Must be implemented by derived classes

Implements ROOT::Math::IBaseFunctionMultiDim.

Definition at line 135 of file GSLNLSMinimizer.h.

Referenced by DoDerivative(), and FdF().

void ROOT::Math::LSResidualFunc::FdF ( const double x,
double f,
double 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

Reimplemented from ROOT::Math::IGradientFunctionMultiDim.

Definition at line 120 of file GSLNLSMinimizer.h.

Referenced by Gradient().

void ROOT::Math::LSResidualFunc::Gradient ( const double x,
double 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 evaluting one at a time

Reimplemented from ROOT::Math::IGradientFunctionMultiDim.

Definition at line 115 of file GSLNLSMinimizer.h.

unsigned int ROOT::Math::LSResidualFunc::NDim ( ) const
inlinevirtual

Retrieve the dimension of the function.

Implements ROOT::Math::IBaseFunctionMultiDim.

Definition at line 113 of file GSLNLSMinimizer.h.

Referenced by DoDerivative(), and FdF().

LSResidualFunc& ROOT::Math::LSResidualFunc::operator= ( const LSResidualFunc rhs)
inline

Definition at line 101 of file GSLNLSMinimizer.h.

Referenced by LSResidualFunc().

Member Data Documentation

const ROOT::Math::FitMethodFunction* ROOT::Math::LSResidualFunc::fChi2
private

Definition at line 148 of file GSLNLSMinimizer.h.

Referenced by Clone(), DoEval(), NDim(), and operator=().

unsigned int ROOT::Math::LSResidualFunc::fIndex
private

Definition at line 147 of file GSLNLSMinimizer.h.

Referenced by Clone(), DoEval(), and operator=().

std::vector<double> ROOT::Math::LSResidualFunc::fX2
mutableprivate

Definition at line 149 of file GSLNLSMinimizer.h.

Referenced by DoDerivative(), FdF(), and operator=().

Collaboration diagram for ROOT::Math::LSResidualFunc:
[legend]

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