27 #ifndef ROOT_Math_GSLNLSMinimizer
28 #define ROOT_Math_GSLNLSMinimizer
32 #ifndef ROOT_Math_BasicMinimizer
37 #ifndef ROOT_Math_IFunctionfwd
41 #ifndef ROOT_Math_IParamFunctionfwd
45 #ifndef ROOT_Math_FitMethodFunction
49 #ifndef ROOT_Math_MinimTransformVariable
120 void FdF (
const double *
x,
double &
f,
double *
g)
const {
121 unsigned int n =
NDim();
122 std::copy(x,x+n,
fX2.begin());
123 const double kEps = 1.0E-4;
125 for (
unsigned int i = 0; i <
n; ++i) {
127 g[i] = (
DoEval(&
fX2.front()) - f )/kEps;
141 std::copy(x,x+
NDim(),
fX2.begin());
142 const double kEps = 1.0E-4;
149 mutable std::vector<double>
fX2;
188 if (
this == &rhs)
return *
this;
234 virtual double CovMatrix(
unsigned int ,
unsigned int )
const;
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...
Interface (abstract class) for multi-dimensional functions providing a gradient calculation.
LSResidualFunc & operator=(const LSResidualFunc &rhs)
~GSLNLSMinimizer()
Destructor (no operations)
virtual double Edm() const
return expected distance reached from the minimum
virtual const double * MinGradient() const
return pointer to gradient values at the minimum
std::vector< double > fErrors
Namespace for new ROOT classes and functions.
const ROOT::Math::FitMethodFunction * fChi2Func
GSLMultiFit, internal class for implementing GSL non linear least square GSL fitting.
GSLNLSMinimizer(const GSLNLSMinimizer &)
Copy constructor.
Base Minimizer class, which defines the basic funcionality of various minimizer implementations (apar...
ROOT::Math::GSLMultiFit * fGSLMultiFit
std::vector< double > fCovMatrix
std::vector< double > fX2
virtual void SetFunction(const ROOT::Math::IMultiGenFunction &func)
set the function to minimize
IMultiGenFunction * Clone() const
Clone a function.
virtual int CovMatrixStatus() const
return covariance matrix status
GSLNLSMinimizer(int type=0)
Default constructor.
virtual unsigned int NDim() const
Number of dimension (parameters) .
double DoDerivative(const double *x, unsigned int icoord) const
function to evaluate the derivative with respect each coordinate.
virtual bool Minimize()
method to perform the minimization
virtual unsigned int NCalls() const
number of function calls to reach the minimum
virtual bool ProvidesError() const
number of free variables (real dimension of the problem) this is <= Function().NDim() which is the to...
LSResidualFunc class description.
FitMethodFunction class Interface for objective functions (like chi2 and likelihood used in the fit) ...
GSLNLSMinimizer class for Non Linear Least Square fitting It Uses the Levemberg-Marquardt algorithm f...
const ROOT::Math::FitMethodFunction * fChi2
double func(double *x, double *p)
virtual double CovMatrix(unsigned int, unsigned int) const
return covariance matrices elements if the variable is fixed the matrix is zero The ordering of the v...
GSLNLSMinimizer & operator=(const GSLNLSMinimizer &rhs)
Assignment operator.
void Gradient(const double *x, double *g) const
Evaluate all the vector of function derivatives (gradient) at a point x.
std::vector< LSResidualFunc > fResiduals
LSResidualFunc(const ROOT::Math::FitMethodFunction &func, unsigned int i)
Namespace for new Math classes and functions.
LSResidualFunc(const LSResidualFunc &rhs)
double DoEval(const double *x) const
Implementation of the evaluation function.
virtual const double * Errors() const
return errors at the minimum
virtual unsigned int NCalls() const
return the total number of function calls (overrided if needed)
Documentation for the abstract class IBaseFunctionMultiDim.
unsigned int NDim() const
Retrieve the dimension of the function.
virtual double DataElement(const double *x, unsigned int i, double *g=0) const =0
method returning the data i-th contribution to the fit objective function For example the residual fo...