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;
202 virtual bool Minimize();
206 virtual double Edm()
const {
return fEdm; }
210 virtual const double * MinGradient()
const;
213 virtual unsigned int NCalls()
const {
return (fChi2Func) ? fChi2Func->NCalls() : 0; }
223 virtual const double *
Errors()
const {
return (fErrors.size() > 0) ? &fErrors.front() : 0; }
234 virtual double CovMatrix(
unsigned int ,
unsigned int )
const;
237 virtual int CovMatrixStatus()
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)
virtual double Edm() const
return expected distance reached from the minimum
std::vector< double > fErrors
This namespace contains pre-defined functions to be used in conjuction with TExecutor::Map and TExecu...
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
IMultiGenFunction * Clone() const
Clone a function.
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 unsigned int NCalls() const
number of function calls to reach the minimum
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...
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)
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
Documentation for the abstract class IBaseFunctionMultiDim.
unsigned int NDim() const
Retrieve the dimension of the function.