27 #ifndef ROOT_Math_GSLNLSMinimizer 28 #define ROOT_Math_GSLNLSMinimizer 110 void FdF (
const double *
x,
double & f,
double *
g)
const {
111 unsigned int n =
NDim();
112 std::copy(x,x+n,
fX2.begin());
113 const double kEps = 1.0E-4;
115 for (
unsigned int i = 0; i <
n; ++i) {
117 g[i] = (
DoEval(&
fX2.front()) - f )/kEps;
131 std::copy(x,x+
NDim(),
fX2.begin());
132 const double kEps = 1.0E-4;
139 mutable std::vector<double>
fX2;
178 if (
this == &rhs)
return *
this;
192 virtual bool Minimize();
196 virtual double Edm()
const {
return fEdm; }
200 virtual const double * MinGradient()
const;
203 virtual unsigned int NCalls()
const {
return (fChi2Func) ? fChi2Func->NCalls() : 0; }
213 virtual const double *
Errors()
const {
return (fErrors.size() > 0) ? &fErrors.front() : 0; }
224 virtual double CovMatrix(
unsigned int ,
unsigned int )
const;
227 virtual int CovMatrixStatus()
const;
LSResidualFunc & operator=(const LSResidualFunc &rhs)
virtual const double * Errors() const
return errors at the minimum
Interface (abstract class) for multi-dimensional functions providing a gradient calculation.
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.
double DoEval(const double *x) const
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
IMultiGenFunction * Clone() const
Clone a function.
virtual unsigned int NCalls() const
number of function calls to reach the minimum
virtual double Edm() const
return expected distance reached from the minimum
Documentation for the abstract class IBaseFunctionMultiDim.
double DoDerivative(const double *x, unsigned int icoord) const
void Gradient(const double *x, double *g) const
void FdF(const double *x, double &f, double *g) const
virtual unsigned int NDim() const
Number of dimension (parameters) .
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...
virtual bool ProvidesError() const
number of free variables (real dimension of the problem) this is <= Function().NDim() which is the to...
const ROOT::Math::FitMethodFunction * fChi2
std::vector< LSResidualFunc > fResiduals
LSResidualFunc(const ROOT::Math::FitMethodFunction &func, unsigned int i)
Namespace for new Math classes and functions.
LSResidualFunc(const LSResidualFunc &rhs)
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...
static constexpr double g