BornAgain
1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
|
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 67 of file GSLNLSMinimizer.h.
Public Types | |
typedef T | BackendType |
typedef IBaseFunctionMultiDimTempl< T > | BaseFunc |
typedef IGradientMultiDimTempl< T > | BaseGrad |
Public Member Functions | |
LSResidualFunc () | |
LSResidualFunc (const LSResidualFunc &rhs) | |
LSResidualFunc (const ROOT::Math::FitMethodFunction &func, unsigned int i) | |
IMultiGenFunction * | Clone () const |
T | Derivative (const T *x, unsigned int icoord=0) const |
void | FdF (const double *x, double &f, double *g) const |
virtual void | FdF (const T *x, T &f, T *df) const |
void | Gradient (const double *x, double *g) const |
virtual void | Gradient (const T *x, T *grad) const |
unsigned int | NDim () const |
virtual unsigned int | NDim () const=0 |
T | operator() (const T *x) const |
LSResidualFunc & | operator= (const LSResidualFunc &rhs) |
Private Member Functions | |
double | DoDerivative (const double *x, unsigned int icoord) const |
double | DoEval (const double *x) const |
Private Attributes | |
const ROOT::Math::FitMethodFunction * | fChi2 |
unsigned int | fIndex |
std::vector< double > | fX2 |
|
inherited |
Definition at line 66 of file IFunction.h.
|
inherited |
Definition at line 330 of file IFunction.h.
|
inherited |
Definition at line 331 of file IFunction.h.
|
inline |
Definition at line 71 of file GSLNLSMinimizer.h.
Referenced by Clone().
|
inline |
Definition at line 75 of file GSLNLSMinimizer.h.
|
inline |
Definition at line 83 of file GSLNLSMinimizer.h.
References operator=().
|
inlinevirtual |
Clone a function. Each derived class must implement their version of the Clone method
Implements ROOT::Math::IBaseFunctionMultiDimTempl< T >.
Definition at line 99 of file GSLNLSMinimizer.h.
References LSResidualFunc(), fChi2, and fIndex.
|
inlineinherited |
Return the partial derivative with respect to the passed coordinate
Definition at line 217 of file IFunction.h.
References ROOT::Math::IGradientMultiDimTempl< T >::DoDerivative().
Referenced by ROOT::Math::MinimTransformFunction::DoDerivative(), and ROOT::Math::IGradientFunctionMultiDimTempl< T >::Gradient().
|
inlineprivate |
Definition at line 132 of file GSLNLSMinimizer.h.
References DoEval(), fX2, and NDim().
|
inlineprivate |
Definition at line 128 of file GSLNLSMinimizer.h.
References ROOT::Math::BasicFitMethodFunction< FunctionType >::DataElement(), fChi2, and fIndex.
Referenced by DoDerivative(), and FdF().
|
inline |
Definition at line 110 of file GSLNLSMinimizer.h.
References ROOT::Math::BasicFitMethodFunction< FunctionType >::DataElement(), DoEval(), fChi2, and fIndex.
Referenced by Gradient().
|
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
Implements ROOT::Math::IGradientMultiDimTempl< T >.
Definition at line 357 of file IFunction.h.
References ROOT::Math::IGradientFunctionMultiDimTempl< T >::Gradient(), and ROOT::Math::IBaseFunctionMultiDimTempl< T >::operator()().
|
inline |
Definition at line 105 of file GSLNLSMinimizer.h.
References FdF().
|
inlinevirtualinherited |
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
Implements ROOT::Math::IGradientMultiDimTempl< T >.
Definition at line 342 of file IFunction.h.
References ROOT::Math::IGradientMultiDimTempl< T >::Derivative(), and ROOT::Math::IGradientFunctionMultiDimTempl< T >::NDim().
Referenced by ROOT::Math::IGradientFunctionMultiDimTempl< T >::FdF().
|
inlinevirtual |
Retrieve the dimension of the function
Implements ROOT::Math::IBaseFunctionMultiDimTempl< T >.
Definition at line 103 of file GSLNLSMinimizer.h.
References fChi2, and ROOT::Math::BasicFitMethodFunction< FunctionType >::NDim().
Referenced by DoDerivative().
|
inherited |
Retrieve the dimension of the function
Referenced by ROOT::Math::IGradientFunctionMultiDimTempl< T >::Gradient(), ROOT::Math::MinimTransformFunction::NTot(), and ROOT::Math::GSLMultiMinimizer::Set().
|
inlineinherited |
Evaluate the function at a point x[]. Use the pure virtual private method DoEval which must be implemented by the sub-classes
Definition at line 92 of file IFunction.h.
References ROOT::Math::IBaseFunctionMultiDimTempl< T >::DoEval().
Referenced by ROOT::Math::IGradientFunctionMultiDimTempl< T >::FdF().
|
inline |
Definition at line 91 of file GSLNLSMinimizer.h.
References fChi2, fIndex, and fX2.
Referenced by LSResidualFunc().
|
private |
Definition at line 141 of file GSLNLSMinimizer.h.
Referenced by Clone(), DoEval(), FdF(), NDim(), and operator=().
|
private |
Definition at line 140 of file GSLNLSMinimizer.h.
Referenced by Clone(), DoEval(), FdF(), and operator=().
|
mutableprivate |
Definition at line 142 of file GSLNLSMinimizer.h.
Referenced by DoDerivative(), and operator=().