Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
Minimizer.h
Go to the documentation of this file.
1// @(#)root/mathcore:$Id$
2// Author: L. Moneta Fri Sep 22 15:06:47 2006
3
4/**********************************************************************
5 * *
6 * Copyright (c) 2006 LCG ROOT Math Team, CERN/PH-SFT *
7 * *
8 * *
9 **********************************************************************/
10
11// Header file for class Minimizer
12
13#ifndef ROOT_Math_Minimizer
14#define ROOT_Math_Minimizer
15
16#include "Math/IFunction.h"
18
19#include <ROOT/RSpan.hxx>
20
21#include <string>
22#include <limits>
23#include <cmath>
24#include <vector>
25#include <functional>
26
27
28
29namespace ROOT {
30
31 namespace Fit {
32 class ParameterSettings;
33 }
34
35
36 namespace Math {
37
38/**
39 @defgroup MultiMin Multi-dimensional Minimization
40 @ingroup NumAlgo
41
42 Classes implementing algorithms for multi-dimensional minimization
43 */
44
45
46
47//_______________________________________________________________________________
48/**
49 Abstract Minimizer class, defining the interface for the various minimizer
50 (like Minuit2, Minuit, GSL, etc..) in ROOT.
51 Plug-in's exist in ROOT to be able to instantiate the derived classes without linking the library
52 using the static function ROOT::Math::Factory::CreateMinimizer.
53
54 Here is the list of all possible minimizers and their respective methods (algorithms) that can be instantiated:
55 The name shown below can be used to create them. More documentation can be found in the respective class
56
57 - Minuit (class TMinuitMinimizer)
58 - Migrad (default)
59 - MigradImproved (Migrad with adding a method to improve minimization when ends-up in a local minimum, see par. 6.3 of [Minuit tutorial on Function Minimization](https://seal.web.cern.ch/documents/minuit/mntutorial.pdf))
60 - Simplex
61 - Minimize (a combination of Simplex + Migrad)
62 - Minimize
63 - Scan
64 - Seek
65
66 - Minuit2 (class ROOT::Minuit2::Minuit2Minimizer)
67 - Migrad (default)
68 - Simplex
69 - Minimize
70 - Fumili (Fumili2)
71 - Scan
72
73 - Fumili (class TFumiliMinimizer)
74
75 - GSLMultiMin (class ROOT::Math::GSLMinimizer) available when ROOT is built with `mathmore` support
76 - BFGS2 (Default)
77 - BFGS
78 - ConjugateFR
79 - ConjugatePR
80 - SteepestDescent
81
82 - GSLMultiFit (class ROOT::Math::GSLNLMinimizer) available when ROOT is built `mathmore` support
83
84 - GSLSimAn (class ROOT::Math::GSLSimAnMinimizer) available when ROOT is built with `mathmore` support
85
86 - Genetic (class ROOT::Math::GeneticMinimizer)
87
88 - RMinimizer (class ROOT::Math::RMinimizer) available when ROOT is built with `r` support
89 - BFGS (default)
90 - L-BFGS-S
91 - Nelder-Mead
92 - CG
93 - and more methods, see the Details in the documentation of the function `optimix` of the [optmix R package](https://cran.r-project.org/web/packages/optimx/optimx.pdf)
94
95
96 The Minimizer class provides the interface to perform the minimization including
97
98
99 In addition to provide the API for function minimization (via ROOT::Math::Minimizer::Minimize) the Minimizer class provides:
100 - the interface for setting the function to be minimized. The objective function passed to the Minimizer must implement the multi-dimensional generic interface
101 ROOT::Math::IBaseFunctionMultiDim. If the function provides gradient calculation (e.g. implementing the ROOT::Math::IGradientFunctionMultiDim interface)
102 the gradient will be used by the Minimizer class, when needed. There are convenient classes for the users to wrap their own functions in this required interface for minimization.
103 These are the `ROOT::Math::Functor` class and the `ROOT::Math::GradFunctor` class for wrapping functions providing both evaluation and gradient. Some methods, like Fumili, Fumili2 and GSLMultiFit are
104 specialized method for least-square and also likelihood minimizations. They require then that the given function implements in addition
105 the `ROOT::Math::FitMethodFunction` interface.
106 - The interface for setting the initial values for the function variables (which are the parameters in
107 of the model function in case of solving for fitting) and specifying their limits.
108 - The interface to set and retrieve basic minimization parameters. These parameter are controlled by the class `ROOT::Math::MinimizerOptions`.
109 When no parameters are specified the default ones are used. Specific Minimizer options can also be passed via the `MinimizerOptions` class.
110 For the list of the available option parameter one must look at the documentation of the corresponding derived class.
111 - The interface to retrieve the result of minimization ( minimum X values, function value, gradient, error on the minimum, etc...)
112 - The interface to perform a Scan, Hesse or a Contour plot (for the minimizers that support this, i.e. Minuit and Minuit2)
113
114 An example on how to use this interface is the tutorial NumericalMinimization.C in the tutorials/fit directory.
115
116 @ingroup MultiMin
117*/
118
120
121public:
122
123 /// Default constructor.
125
126 /// Destructor (no operations).
127 virtual ~Minimizer () {}
128
129 // usually copying is non trivial, so we delete this
130 Minimizer(Minimizer const&) = delete;
131 Minimizer &operator=(Minimizer const&) = delete;
132 Minimizer(Minimizer &&) = delete;
134
135 /// reset for consecutive minimization - implement if needed
136 virtual void Clear() {}
137
138 /// set the function to minimize
139 virtual void SetFunction(const ROOT::Math::IMultiGenFunction & func) = 0;
140
141 /// set the function implementing Hessian computation (re-implemented by Minimizer using it)
142 virtual void SetHessianFunction(std::function<bool(std::span<const double>, double *)> ) {}
143
144 /// add variables . Return number of variables successfully added
145 template<class VariableIterator>
146 int SetVariables(const VariableIterator & begin, const VariableIterator & end) {
147 unsigned int ivar = 0;
148 for ( VariableIterator vitr = begin; vitr != end; ++vitr) {
149 bool iret = false;
150 if (vitr->IsFixed() )
151 iret = SetFixedVariable(ivar, vitr->Name(), vitr->Value() );
152 else if (vitr->IsDoubleBound() )
153 iret = SetLimitedVariable(ivar, vitr->Name(), vitr->Value(), vitr->StepSize(), vitr->LowerLimit(), vitr->UpperLimit() );
154 else if (vitr->HasLowerLimit() )
155 iret = SetLowerLimitedVariable(ivar, vitr->Name(), vitr->Value(), vitr->StepSize(), vitr->LowerLimit() );
156 else if (vitr->HasUpperLimit() )
157 iret = SetUpperLimitedVariable(ivar, vitr->Name(), vitr->Value(), vitr->StepSize(), vitr->UpperLimit() );
158 else
159 iret = SetVariable( ivar, vitr->Name(), vitr->Value(), vitr->StepSize() );
160
161 if (iret) ivar++;
162
163 // an error message should be eventually be reported in the virtual single SetVariable methods
164 }
165 return ivar;
166 }
167 /// set a new free variable
168 virtual bool SetVariable(unsigned int ivar, const std::string & name, double val, double step) = 0;
169 /// set initial second derivatives
170 virtual bool SetCovarianceDiag(std::span<const double> d2, unsigned int n);
171 /// set initial covariance matrix
172 virtual bool SetCovariance(std::span<const double> cov, unsigned int nrow);
173
174 /// set a new lower limit variable (override if minimizer supports them )
175 virtual bool SetLowerLimitedVariable(unsigned int ivar , const std::string & name , double val , double step , double lower ) {
176 return SetLimitedVariable(ivar, name, val, step, lower, std::numeric_limits<double>::infinity() );
177 }
178 /// set a new upper limit variable (override if minimizer supports them )
179 virtual bool SetUpperLimitedVariable(unsigned int ivar , const std::string & name , double val , double step , double upper ) {
180 return SetLimitedVariable(ivar, name, val, step, - std::numeric_limits<double>::infinity(), upper );
181 }
182 virtual bool SetLimitedVariable(unsigned int ivar , const std::string & name , double val , double step ,
183 double lower , double upper );
184 virtual bool SetFixedVariable(unsigned int ivar , const std::string & name , double val );
185 virtual bool SetVariableValue(unsigned int ivar , double value);
186 /// set the values of all existing variables (array must be dimensioned to the size of the existing parameters)
187 virtual bool SetVariableValues(const double * x) {
188 bool ret = true;
189 unsigned int i = 0;
190 while ( i <= NDim() && ret) {
191 ret &= SetVariableValue(i,x[i] ); i++;
192 }
193 return ret;
194 }
195 virtual bool SetVariableStepSize(unsigned int ivar, double value );
196 virtual bool SetVariableLowerLimit(unsigned int ivar, double lower);
197 virtual bool SetVariableUpperLimit(unsigned int ivar, double upper);
198 /// set the limits of an already existing variable
199 virtual bool SetVariableLimits(unsigned int ivar, double lower, double upper) {
200 return SetVariableLowerLimit(ivar,lower) && SetVariableUpperLimit(ivar,upper);
201 }
202 virtual bool FixVariable(unsigned int ivar);
203 virtual bool ReleaseVariable(unsigned int ivar);
204 virtual bool IsFixedVariable(unsigned int ivar) const;
205 virtual bool GetVariableSettings(unsigned int ivar, ROOT::Fit::ParameterSettings & pars) const;
206
207 /// set the initial range of an existing variable
208 virtual bool SetVariableInitialRange(unsigned int /* ivar */, double /* mininitial */, double /* maxinitial */) {
209 return false;
210 }
211
212 /// method to perform the minimization
213 virtual bool Minimize() = 0;
214
215 /// return minimum function value
216 virtual double MinValue() const = 0;
217
218 /// return pointer to X values at the minimum
219 virtual const double * X() const = 0;
220
221 /// return expected distance reached from the minimum (re-implement if minimizer provides it
222 virtual double Edm() const { return -1; }
223
224 /// return pointer to gradient values at the minimum
225 virtual const double * MinGradient() const { return nullptr; }
226
227 /// number of function calls to reach the minimum
228 virtual unsigned int NCalls() const { return 0; }
229
230 /// number of iterations to reach the minimum
231 virtual unsigned int NIterations() const { return NCalls(); }
232
233 /// this is <= Function().NDim() which is the total
234 /// number of variables (free+ constrained ones)
235 virtual unsigned int NDim() const = 0;
236
237 /// number of free variables (real dimension of the problem)
238 /// this is <= Function().NDim() which is the total
239 /// (re-implement if minimizer supports bounded parameters)
240 virtual unsigned int NFree() const { return NDim(); }
241
242 /// minimizer provides error and error matrix
243 virtual bool ProvidesError() const { return false; }
244
245 /// return errors at the minimum
246 virtual const double * Errors() const { return nullptr; }
247
248 virtual double CovMatrix(unsigned int ivar , unsigned int jvar ) const;
249 virtual bool GetCovMatrix(double * covMat) const;
250 virtual bool GetHessianMatrix(double * hMat) const;
251
252
253 ///return status of covariance matrix
254 /// using Minuit convention {0 not calculated 1 approximated 2 made pos def , 3 accurate}
255 /// Minimizer who implements covariance matrix calculation will re-implement the method
256 virtual int CovMatrixStatus() const {
257 return 0;
258 }
259
260 /**
261 return correlation coefficient between variable i and j.
262 If the variable is fixed or const the return value is zero
263 */
264 virtual double Correlation(unsigned int i, unsigned int j ) const {
265 double tmp = CovMatrix(i,i) * CovMatrix(j,j);
266 return ( tmp < 0) ? 0 : CovMatrix(i,j) / std::sqrt( tmp );
267 }
268
269 virtual double GlobalCC(unsigned int ivar) const;
270
271 virtual bool GetMinosError(unsigned int ivar , double & errLow, double & errUp, int option = 0);
272 virtual bool Hesse();
273 virtual bool Scan(unsigned int ivar , unsigned int & nstep , double * x , double * y ,
274 double xmin = 0, double xmax = 0);
275 virtual bool Contour(unsigned int ivar , unsigned int jvar, unsigned int & npoints,
276 double * xi , double * xj );
277
278 /// return reference to the objective function
279 ///virtual const ROOT::Math::IGenFunction & Function() const = 0;
280
281 /// print the result according to set level (implemented for TMinuit for maintaining Minuit-style printing)
282 virtual void PrintResults() {}
283
284 virtual std::string VariableName(unsigned int ivar) const;
285
286 virtual int VariableIndex(const std::string & name) const;
287
288 /** minimizer configuration parameters **/
289
290 /// set print level
291 int PrintLevel() const { return fOptions.PrintLevel(); }
292
293 /// max number of function calls
294 unsigned int MaxFunctionCalls() const { return fOptions.MaxFunctionCalls(); }
295
296 /// max iterations
297 unsigned int MaxIterations() const { return fOptions.MaxIterations(); }
298
299 /// absolute tolerance
300 double Tolerance() const { return fOptions.Tolerance(); }
301
302 /// precision of minimizer in the evaluation of the objective function
303 /// ( a value <=0 corresponds to the let the minimizer choose its default one)
304 double Precision() const { return fOptions.Precision(); }
305
306 /// strategy
307 int Strategy() const { return fOptions.Strategy(); }
308
309 /// status code of minimizer
310 int Status() const { return fStatus; }
311
312 /// status code of Minos (to be re-implemented by the minimizers supporting Minos)
313 virtual int MinosStatus() const { return -1; }
314
315 /// return the statistical scale used for calculate the error
316 /// is typically 1 for Chi2 and 0.5 for likelihood minimization
317 double ErrorDef() const { return fOptions.ErrorDef(); }
318
319 ///return true if Minimizer has performed a detailed error validation (e.g. run Hesse for Minuit)
320 bool IsValidError() const { return fValidError; }
321
322 /// retrieve the minimizer options (implement derived class if needed)
323 virtual MinimizerOptions Options() const {
324 return fOptions;
325 }
326
327 /// set print level
328 void SetPrintLevel(int level) { fOptions.SetPrintLevel(level); }
329
330 ///set maximum of function calls
331 void SetMaxFunctionCalls(unsigned int maxfcn) { if (maxfcn > 0) fOptions.SetMaxFunctionCalls(maxfcn); }
332
333 /// set maximum iterations (one iteration can have many function calls)
334 void SetMaxIterations(unsigned int maxiter) { if (maxiter > 0) fOptions.SetMaxIterations(maxiter); }
335
336 /// set the tolerance
337 void SetTolerance(double tol) { fOptions.SetTolerance(tol); }
338
339 /// set in the minimizer the objective function evaluation precision
340 /// ( a value <=0 means the minimizer will choose its optimal value automatically, i.e. default case)
341 void SetPrecision(double prec) { fOptions.SetPrecision(prec); }
342
343 ///set the strategy
344 void SetStrategy(int strategyLevel) { fOptions.SetStrategy(strategyLevel); }
345
346 /// set scale for calculating the errors
347 void SetErrorDef(double up) { fOptions.SetErrorDef(up); }
348
349 /// flag to check if minimizer needs to perform accurate error analysis (e.g. run Hesse for Minuit)
350 void SetValidError(bool on) { fValidError = on; }
351
352 /// set all options in one go
353 void SetOptions(const MinimizerOptions & opt) {
354 fOptions = opt;
355 }
356
357 /// set only the extra options
358 void SetExtraOptions(const IOptions & extraOptions) { fOptions.SetExtraOptions(extraOptions); }
359
360 /// reset the default options (defined in MinimizerOptions)
363 }
364
365protected:
366
367 // keep protected to be accessible by the derived classes
368
369 bool fValidError = false; ///< flag to control if errors have been validated (Hesse has been run in case of Minuit)
370 MinimizerOptions fOptions; ///< minimizer options
371 int fStatus = -1; ///< status of minimizer
372};
373
374 } // end namespace Math
375
376} // end namespace ROOT
377
378
379#endif /* ROOT_Math_Minimizer */
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void on
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
char name[80]
Definition TGX11.cxx:110
float xmin
float xmax
Class, describing value, limits and step size of the parameters Provides functionality also to set/re...
Documentation for the abstract class IBaseFunctionMultiDim.
Definition IFunction.h:61
Generic interface for defining configuration options of a numerical algorithm.
Definition IOptions.h:28
void SetMaxFunctionCalls(unsigned int maxfcn)
set maximum of function calls
void SetStrategy(int stra)
set the strategy
void SetMaxIterations(unsigned int maxiter)
set maximum iterations (one iteration can have many function calls)
double Tolerance() const
absolute tolerance
double Precision() const
precision in the objective function calculation (value <=0 means left to default)
double ErrorDef() const
error definition
void SetExtraOptions(const IOptions &opt)
set extra options (in this case pointer is cloned)
unsigned int MaxIterations() const
max iterations
void SetPrecision(double prec)
set the precision
unsigned int MaxFunctionCalls() const
max number of function calls
void ResetToDefaultOptions()
non-static methods for setting options
int PrintLevel() const
non-static methods for retrieving options
void SetErrorDef(double err)
set error def
void SetPrintLevel(int level)
set print level
void SetTolerance(double tol)
set the tolerance
Abstract Minimizer class, defining the interface for the various minimizer (like Minuit2,...
Definition Minimizer.h:119
virtual bool SetLimitedVariable(unsigned int ivar, const std::string &name, double val, double step, double lower, double upper)
set a new upper/lower limited variable (override if minimizer supports them ) otherwise as default se...
Definition Minimizer.cxx:34
double Tolerance() const
absolute tolerance
Definition Minimizer.h:300
virtual const double * Errors() const
return errors at the minimum
Definition Minimizer.h:246
virtual int VariableIndex(const std::string &name) const
get index of variable given a variable given a name return -1 if variable is not found
unsigned int MaxFunctionCalls() const
max number of function calls
Definition Minimizer.h:294
virtual bool GetCovMatrix(double *covMat) const
Fill the passed array with the covariance matrix elements if the variable is fixed or const the value...
virtual bool SetLowerLimitedVariable(unsigned int ivar, const std::string &name, double val, double step, double lower)
set a new lower limit variable (override if minimizer supports them )
Definition Minimizer.h:175
virtual bool SetVariableStepSize(unsigned int ivar, double value)
set the step size of an already existing variable
Definition Minimizer.cxx:62
double Precision() const
precision of minimizer in the evaluation of the objective function ( a value <=0 corresponds to the l...
Definition Minimizer.h:304
virtual void SetHessianFunction(std::function< bool(std::span< const double >, double *)>)
set the function implementing Hessian computation (re-implemented by Minimizer using it)
Definition Minimizer.h:142
virtual bool SetCovarianceDiag(std::span< const double > d2, unsigned int n)
set initial second derivatives
Definition Minimizer.cxx:15
virtual const double * X() const =0
return pointer to X values at the minimum
virtual unsigned int NIterations() const
number of iterations to reach the minimum
Definition Minimizer.h:231
void SetMaxIterations(unsigned int maxiter)
set maximum iterations (one iteration can have many function calls)
Definition Minimizer.h:334
virtual bool SetVariableInitialRange(unsigned int, double, double)
set the initial range of an existing variable
Definition Minimizer.h:208
void SetErrorDef(double up)
set scale for calculating the errors
Definition Minimizer.h:347
virtual bool GetVariableSettings(unsigned int ivar, ROOT::Fit::ParameterSettings &pars) const
get variable settings in a variable object (like ROOT::Fit::ParamsSettings)
void SetValidError(bool on)
flag to check if minimizer needs to perform accurate error analysis (e.g. run Hesse for Minuit)
Definition Minimizer.h:350
int SetVariables(const VariableIterator &begin, const VariableIterator &end)
add variables . Return number of variables successfully added
Definition Minimizer.h:146
virtual double GlobalCC(unsigned int ivar) const
return global correlation coefficient for variable i This is a number between zero and one which give...
virtual const double * MinGradient() const
return pointer to gradient values at the minimum
Definition Minimizer.h:225
Minimizer(Minimizer &&)=delete
int fStatus
status of minimizer
Definition Minimizer.h:371
virtual bool SetVariableValue(unsigned int ivar, double value)
set the value of an already existing variable
Definition Minimizer.cxx:53
virtual void SetFunction(const ROOT::Math::IMultiGenFunction &func)=0
set the function to minimize
virtual bool Scan(unsigned int ivar, unsigned int &nstep, double *x, double *y, double xmin=0, double xmax=0)
scan function minimum for variable i.
unsigned int MaxIterations() const
max iterations
Definition Minimizer.h:297
void SetDefaultOptions()
reset the default options (defined in MinimizerOptions)
Definition Minimizer.h:361
bool fValidError
flag to control if errors have been validated (Hesse has been run in case of Minuit)
Definition Minimizer.h:369
virtual int MinosStatus() const
status code of Minos (to be re-implemented by the minimizers supporting Minos)
Definition Minimizer.h:313
virtual bool SetVariableLimits(unsigned int ivar, double lower, double upper)
set the limits of an already existing variable
Definition Minimizer.h:199
void SetTolerance(double tol)
set the tolerance
Definition Minimizer.h:337
Minimizer(Minimizer const &)=delete
virtual int CovMatrixStatus() const
return status of covariance matrix using Minuit convention {0 not calculated 1 approximated 2 made po...
Definition Minimizer.h:256
virtual bool Minimize()=0
method to perform the minimization
int Status() const
status code of minimizer
Definition Minimizer.h:310
virtual bool SetVariableUpperLimit(unsigned int ivar, double upper)
set the upper-limit of an already existing variable
Definition Minimizer.cxx:78
virtual bool SetCovariance(std::span< const double > cov, unsigned int nrow)
set initial covariance matrix
Definition Minimizer.cxx:25
Minimizer()
Default constructor.
Definition Minimizer.h:124
virtual std::string VariableName(unsigned int ivar) const
get name of variables (override if minimizer support storing of variable names) return an empty strin...
void SetPrintLevel(int level)
set print level
Definition Minimizer.h:328
virtual double CovMatrix(unsigned int ivar, unsigned int jvar) const
return covariance matrices element for variables ivar,jvar if the variable is fixed the return value ...
virtual bool GetHessianMatrix(double *hMat) const
Fill the passed array with the Hessian matrix elements The Hessian matrix is the matrix of the second...
int Strategy() const
strategy
Definition Minimizer.h:307
virtual unsigned int NCalls() const
number of function calls to reach the minimum
Definition Minimizer.h:228
virtual bool SetUpperLimitedVariable(unsigned int ivar, const std::string &name, double val, double step, double upper)
set a new upper limit variable (override if minimizer supports them )
Definition Minimizer.h:179
Minimizer & operator=(Minimizer &&)=delete
virtual bool SetVariable(unsigned int ivar, const std::string &name, double val, double step)=0
set a new free variable
void SetStrategy(int strategyLevel)
set the strategy
Definition Minimizer.h:344
virtual bool ProvidesError() const
minimizer provides error and error matrix
Definition Minimizer.h:243
virtual bool FixVariable(unsigned int ivar)
fix an existing variable
Definition Minimizer.cxx:87
void SetPrecision(double prec)
set in the minimizer the objective function evaluation precision ( a value <=0 means the minimizer wi...
Definition Minimizer.h:341
virtual MinimizerOptions Options() const
retrieve the minimizer options (implement derived class if needed)
Definition Minimizer.h:323
virtual double Correlation(unsigned int i, unsigned int j) const
return correlation coefficient between variable i and j.
Definition Minimizer.h:264
virtual ~Minimizer()
Destructor (no operations).
Definition Minimizer.h:127
double ErrorDef() const
return the statistical scale used for calculate the error is typically 1 for Chi2 and 0....
Definition Minimizer.h:317
MinimizerOptions fOptions
minimizer options
Definition Minimizer.h:370
Minimizer & operator=(Minimizer const &)=delete
virtual bool SetFixedVariable(unsigned int ivar, const std::string &name, double val)
set a new fixed variable (override if minimizer supports them )
Definition Minimizer.cxx:44
void SetMaxFunctionCalls(unsigned int maxfcn)
set maximum of function calls
Definition Minimizer.h:331
bool IsValidError() const
return true if Minimizer has performed a detailed error validation (e.g. run Hesse for Minuit)
Definition Minimizer.h:320
virtual double Edm() const
return expected distance reached from the minimum (re-implement if minimizer provides it
Definition Minimizer.h:222
virtual bool GetMinosError(unsigned int ivar, double &errLow, double &errUp, int option=0)
minos error for variable i, return false if Minos failed or not supported and the lower and upper err...
void SetOptions(const MinimizerOptions &opt)
set all options in one go
Definition Minimizer.h:353
virtual bool SetVariableValues(const double *x)
set the values of all existing variables (array must be dimensioned to the size of the existing param...
Definition Minimizer.h:187
virtual void Clear()
reset for consecutive minimization - implement if needed
Definition Minimizer.h:136
void SetExtraOptions(const IOptions &extraOptions)
set only the extra options
Definition Minimizer.h:358
virtual double MinValue() const =0
return minimum function value
int PrintLevel() const
minimizer configuration parameters
Definition Minimizer.h:291
virtual void PrintResults()
return reference to the objective function virtual const ROOT::Math::IGenFunction & Function() const ...
Definition Minimizer.h:282
virtual unsigned int NDim() const =0
this is <= Function().NDim() which is the total number of variables (free+ constrained ones)
virtual unsigned int NFree() const
number of free variables (real dimension of the problem) this is <= Function().NDim() which is the to...
Definition Minimizer.h:240
virtual bool SetVariableLowerLimit(unsigned int ivar, double lower)
set the lower-limit of an already existing variable
Definition Minimizer.cxx:70
virtual bool IsFixedVariable(unsigned int ivar) const
query if an existing variable is fixed (i.e.
virtual bool ReleaseVariable(unsigned int ivar)
release an existing variable
Definition Minimizer.cxx:94
virtual bool Hesse()
perform a full calculation of the Hessian matrix for error calculation
virtual bool Contour(unsigned int ivar, unsigned int jvar, unsigned int &npoints, double *xi, double *xj)
find the contour points (xi, xj) of the function for parameter ivar and jvar around the minimum The c...
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
const Int_t n
Definition legend1.C:16
TFitResultPtr Fit(FitObject *h1, TF1 *f1, Foption_t &option, const ROOT::Math::MinimizerOptions &moption, const char *goption, ROOT::Fit::DataRange &range)
Definition HFitImpl.cxx:133
Namespace for new Math classes and functions.
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...