Logo ROOT  
Reference Guide
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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-ins 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 \note Some Minuit2 gradient calculations, such as `Numerical2PGradientCalculator` support parallelization
74 via OpenMP. To profit from this acceleration, one needs to build ROOT using `minuit2_omp=ON`
75 and later call GradientCalculator::SetParallelOMP()
76
77 - Fumili (class TFumiliMinimizer)
78
79 - Linear (see TLinearFitter and TLinearMinimizer) minimizer (fitter) working only for linear functions
80
81 - GSLMultiMin (class ROOT::Math::GSLMinimizer) available when ROOT is built with `mathmore` support
82 - BFGS2 (Default)
83 - BFGS
84 - ConjugateFR
85 - ConjugatePR
86 - SteepestDescent
87
88 - GSLMultiFit (class ROOT::Math::GSLNLMinimizer) available when ROOT is built `mathmore` support
89
90 - GSLSimAn (class ROOT::Math::GSLSimAnMinimizer) available when ROOT is built with `mathmore` support
91
92 - Genetic (class ROOT::Math::GeneticMinimizer)
93
94 - RMinimizer (class ROOT::Math::RMinimizer) available when ROOT is built with `r` support
95 - BFGS (default)
96 - L-BFGS-S
97 - Nelder-Mead
98 - CG
99 - 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)
100
101 In addition to provide the API for function minimization (via ROOT::Math::Minimizer::Minimize) the Minimizer class provides:
102 - the interface for setting the function to be minimized. The objective function passed to the Minimizer must implement the multi-dimensional generic interface
103 ROOT::Math::IBaseFunctionMultiDim. If the function provides gradient calculation (e.g. implementing the ROOT::Math::IGradientFunctionMultiDim interface)
104 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.
105 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
106 specialized method for least-square and also likelihood minimizations. They require then that the given function implements in addition
107 the `ROOT::Math::FitMethodFunction` interface.
108 - The interface for setting the initial values for the function variables (which are the parameters in
109 of the model function in case of solving for fitting) and specifying their limits.
110 - The interface to set and retrieve basic minimization parameters. These parameter are controlled by the class `ROOT::Math::MinimizerOptions`.
111 When no parameters are specified the default ones are used. Specific Minimizer options can also be passed via the `MinimizerOptions` class.
112 For the list of the available option parameter one must look at the documentation of the corresponding derived class.
113 - The interface to retrieve the result of minimization ( minimum X values, function value, gradient, error on the minimum, etc...)
114 - The interface to perform a Scan, Hesse or a Contour plot (for the minimizers that support this, i.e. Minuit and Minuit2)
115
116 An example on how to use this interface is the tutorial NumericalMinimization.C in the tutorials/math directory.
117
118 To get an overview of the default minimizer, tolerance, precision, maximum number of function calls, etc., use:
119 `ROOT::Math::MinimizerOptions::PrintDefault()`
120
121 @ingroup MultiMin
122*/
123
125
126public:
127
128 /// Default constructor.
130
131 /// Destructor (no operations).
132 virtual ~Minimizer () {}
133
134 // usually copying is non trivial, so we delete this
135 Minimizer(Minimizer const&) = delete;
136 Minimizer &operator=(Minimizer const&) = delete;
137 Minimizer(Minimizer &&) = delete;
139
140 /// Reset for consecutive minimization - implement if needed.
141 virtual void Clear() {}
142
143 /// Set the function to minimize.
144 virtual void SetFunction(const ROOT::Math::IMultiGenFunction & func) = 0;
145
146 /// Set the function implementing Hessian computation (re-implemented by Minimizer using it).
147 virtual void SetHessianFunction(std::function<bool(std::span<const double>, double *)> ) {}
148
149 /// Add variables. @return number of variables successfully added
150 template<class VariableIterator>
151 int SetVariables(const VariableIterator & begin, const VariableIterator & end) {
152 unsigned int ivar = 0;
153 for ( VariableIterator vitr = begin; vitr != end; ++vitr) {
154 bool iret = false;
155 if (vitr->IsFixed() )
156 iret = SetFixedVariable(ivar, vitr->Name(), vitr->Value() );
157 else if (vitr->IsDoubleBound() )
158 iret = SetLimitedVariable(ivar, vitr->Name(), vitr->Value(), vitr->StepSize(), vitr->LowerLimit(), vitr->UpperLimit() );
159 else if (vitr->HasLowerLimit() )
160 iret = SetLowerLimitedVariable(ivar, vitr->Name(), vitr->Value(), vitr->StepSize(), vitr->LowerLimit() );
161 else if (vitr->HasUpperLimit() )
162 iret = SetUpperLimitedVariable(ivar, vitr->Name(), vitr->Value(), vitr->StepSize(), vitr->UpperLimit() );
163 else
164 iret = SetVariable( ivar, vitr->Name(), vitr->Value(), vitr->StepSize() );
165
166 if (iret) ivar++;
167
168 // an error message should be eventually be reported in the virtual single SetVariable methods
169 }
170 return ivar;
171 }
172 /// Set a new free variable.
173 virtual bool SetVariable(unsigned int ivar, const std::string & name, double val, double step) = 0;
174 /// Set initial second derivatives.
175 virtual bool SetCovarianceDiag(std::span<const double> d2, unsigned int n);
176 /// Set initial covariance matrix.
177 virtual bool SetCovariance(std::span<const double> cov, unsigned int nrow);
178
179 /// Set a new lower limit variable (override if minimizer supports them), leave upper bound unlimited.
180 /// @see Minimizer::SetLimitedVariable
181 /// @param ivar the index of this variable in the array
182 /// @param name the variable name
183 /// @param val the value
184 /// @param step the step size
185 /// @param lower the lower bound
186 virtual bool SetLowerLimitedVariable(unsigned int ivar, const std::string & name, double val, double step, double lower) {
187 return SetLimitedVariable(ivar, name, val, step, lower, std::numeric_limits<double>::infinity());
188 }
189 /// Set a new upper limit variable (override if minimizer supports them), leave lower bound unlimited.
190 /// @see Minimizer::SetLimitedVariable
191 /// @param ivar the index of this variable in the array
192 /// @param name the variable name
193 /// @param val the value
194 /// @param step the step size
195 /// @param upper the upper bound
196 virtual bool SetUpperLimitedVariable(unsigned int ivar, const std::string & name, double val, double step, double upper) {
197 return SetLimitedVariable(ivar, name, val, step, - std::numeric_limits<double>::infinity(), upper);
198 }
199 virtual bool SetLimitedVariable(unsigned int ivar, const std::string & name, double val, double step,
200 double lower, double upper);
201 virtual bool SetFixedVariable(unsigned int ivar, const std::string & name, double val);
202 virtual bool SetVariableValue(unsigned int ivar, double value);
203 /// Set the values of all existing variables (array must be dimensioned to the size of the existing parameters).
204 virtual bool SetVariableValues(const double * x) {
205 bool ret = true;
206 unsigned int i = 0;
207 while ( i <= NDim() && ret) {
208 ret &= SetVariableValue(i,x[i] ); i++;
209 }
210 return ret;
211 }
212 virtual bool SetVariableStepSize(unsigned int ivar, double value);
213 virtual bool SetVariableLowerLimit(unsigned int ivar, double lower);
214 virtual bool SetVariableUpperLimit(unsigned int ivar, double upper);
215 /// Set the limits of an already existing variable.
216 virtual bool SetVariableLimits(unsigned int ivar, double lower, double upper) {
218 }
219 virtual bool FixVariable(unsigned int ivar);
220 virtual bool ReleaseVariable(unsigned int ivar);
221 virtual bool IsFixedVariable(unsigned int ivar) const;
222 virtual bool GetVariableSettings(unsigned int ivar, ROOT::Fit::ParameterSettings & pars) const;
223
224 /// Set the initial range of an existing variable.
225 virtual bool SetVariableInitialRange(unsigned int /* ivar */, double /* mininitial */, double /* maxinitial */) {
226 return false;
227 }
228
229 /// Method to perform the minimization.
230 virtual bool Minimize() = 0;
231
232 /// @return minimum function value
233 virtual double MinValue() const = 0;
234
235 /// @return pointer to X values at the minimum
236 virtual const double * X() const = 0;
237
238 /// @return expected distance reached from the minimum (re-implement if minimizer provides it
239 virtual double Edm() const { return -1; }
240
241 /// @return pointer to gradient values at the minimum
242 virtual const double * MinGradient() const { return nullptr; }
243
244 /// Number of function calls to reach the minimum.
245 virtual unsigned int NCalls() const { return 0; }
246
247 /// Number of iterations to reach the minimum.
248 virtual unsigned int NIterations() const { return NCalls(); }
249
250 /// this is <= Function().NDim() which is the total
251 /// number of variables (free+ constrained ones)
252 virtual unsigned int NDim() const = 0;
253
254 /// Number of free variables (real dimension of the problem).
255 /// this is <= Function().NDim() which is the total
256 /// (re-implement if minimizer supports bounded parameters)
257 virtual unsigned int NFree() const { return NDim(); }
258
259 /// Minimizer provides error and error matrix.
260 virtual bool ProvidesError() const { return false; }
261
262 /// @return errors at the minimum
263 virtual const double * Errors() const { return nullptr; }
264
265 virtual double CovMatrix(unsigned int ivar , unsigned int jvar ) const;
266 virtual bool GetCovMatrix(double * covMat) const;
267 virtual bool GetHessianMatrix(double * hMat) const;
268
269
270 /// @return status of covariance matrix
271 /// using Minuit convention {0 not calculated 1 approximated 2 made pos def , 3 accurate}
272 /// Minimizer who implements covariance matrix calculation will re-implement the method
273 virtual int CovMatrixStatus() const {
274 return 0;
275 }
276
277 /**
278 * @return correlation coefficient between variable i and j.
279 * If the variable is fixed or const the return value is zero
280 */
281 virtual double Correlation(unsigned int i, unsigned int j ) const {
282 double tmp = CovMatrix(i,i) * CovMatrix(j,j);
283 return ( tmp < 0) ? 0 : CovMatrix(i,j) / std::sqrt( tmp );
284 }
285
286 virtual double GlobalCC(unsigned int ivar) const;
287
288 virtual bool GetMinosError(unsigned int ivar , double & errLow, double & errUp, int option = 0);
289 virtual bool Hesse();
290 virtual bool Scan(unsigned int ivar , unsigned int & nstep , double * x , double * y ,
291 double xmin = 0, double xmax = 0);
292 virtual bool Contour(unsigned int ivar , unsigned int jvar, unsigned int & npoints,
293 double * xi , double * xj );
294
295 /// @return reference to the objective function
296 /// virtual const ROOT::Math::IGenFunction & Function() const = 0;
297
298 /// Print the result according to set level (implemented for TMinuit for maintaining Minuit-style printing).
299 virtual void PrintResults() {}
300
301 virtual std::string VariableName(unsigned int ivar) const;
302
303 virtual int VariableIndex(const std::string & name) const;
304
305 /* minimizer configuration parameters */
306
307 /// Set print level.
308 int PrintLevel() const { return fOptions.PrintLevel(); }
309
310 /// Max number of function calls.
311 unsigned int MaxFunctionCalls() const { return fOptions.MaxFunctionCalls(); }
312
313 /// Max iterations.
314 unsigned int MaxIterations() const { return fOptions.MaxIterations(); }
315
316 /// Absolute tolerance.
317 double Tolerance() const { return fOptions.Tolerance(); }
318
319 /// Precision of minimizer in the evaluation of the objective function.
320 /// (a value <=0 corresponds to the let the minimizer choose its default one)
321 double Precision() const { return fOptions.Precision(); }
322
323 /// Strategy.
324 int Strategy() const { return fOptions.Strategy(); }
325
326 /// Status code of minimizer.
327 int Status() const { return fStatus; }
328
329 /// Status code of Minos (to be re-implemented by the minimizers supporting Minos).
330 virtual int MinosStatus() const { return -1; }
331
332 /// @return the statistical scale used for calculate the error
333 /// is typically 1 for Chi2 and 0.5 for likelihood minimization
334 double ErrorDef() const { return fOptions.ErrorDef(); }
335
336 /// @return true if Minimizer has performed a detailed error validation (e.g. run Hesse for Minuit)
337 bool IsValidError() const { return fValidError; }
338
339 /// Retrieve the minimizer options (implement derived class if needed).
340 virtual MinimizerOptions Options() const {
341 return fOptions;
342 }
343
344 /// Set print level.
345 void SetPrintLevel(int level) { fOptions.SetPrintLevel(level); }
346
347 /// Set maximum of function calls.
349
350 /// Set maximum iterations (one iteration can have many function calls).
352
353 /// Set the tolerance.
355
356 /// Set in the minimizer the objective function evaluation precision.
357 /// (a value <=0 means the minimizer will choose its optimal value automatically, i.e. default case)
359
360 /// Set the strategy.
362
363 /// Set scale for calculating the errors.
365
366 /// Flag to check if minimizer needs to perform accurate error analysis (e.g. run Hesse for Minuit).
367 void SetValidError(bool on) { fValidError = on; }
368
369 /// Set all options in one go.
370 void SetOptions(const MinimizerOptions & opt) {
371 fOptions = opt;
372 }
373
374 /// Set only the extra options.
376
377 /// Reset the default options (defined in MinimizerOptions).
381
382protected:
383
384 // keep protected to be accessible by the derived classes
385
386 bool fValidError = false; ///< flag to control if errors have been validated (Hesse has been run in case of Minuit)
387 MinimizerOptions fOptions; ///< minimizer options
388 int fStatus = -1; ///< status of minimizer
389};
390
391 } // end namespace Math
392
393} // end namespace ROOT
394
395
396#endif /* ROOT_Math_Minimizer */
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
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:63
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:124
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 set...
Definition Minimizer.cxx:42
double Tolerance() const
Absolute tolerance.
Definition Minimizer.h:317
virtual const double * Errors() const
Definition Minimizer.h:263
virtual int VariableIndex(const std::string &name) const
Get index of variable given a variable given a name.
unsigned int MaxFunctionCalls() const
Max number of function calls.
Definition Minimizer.h:311
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), leave upper bound unlimited.
Definition Minimizer.h:186
virtual bool SetVariableStepSize(unsigned int ivar, double value)
Set the step size of an already existing variable.
Definition Minimizer.cxx:70
double Precision() const
Precision of minimizer in the evaluation of the objective function.
Definition Minimizer.h:321
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:147
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
virtual unsigned int NIterations() const
Number of iterations to reach the minimum.
Definition Minimizer.h:248
void SetMaxIterations(unsigned int maxiter)
Set maximum iterations (one iteration can have many function calls).
Definition Minimizer.h:351
virtual bool SetVariableInitialRange(unsigned int, double, double)
Set the initial range of an existing variable.
Definition Minimizer.h:225
void SetErrorDef(double up)
Set scale for calculating the errors.
Definition Minimizer.h:364
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:367
int SetVariables(const VariableIterator &begin, const VariableIterator &end)
Add variables.
Definition Minimizer.h:151
virtual double GlobalCC(unsigned int ivar) const
virtual const double * MinGradient() const
Definition Minimizer.h:242
Minimizer(Minimizer &&)=delete
int fStatus
status of minimizer
Definition Minimizer.h:388
virtual bool SetVariableValue(unsigned int ivar, double value)
Set the value of an already existing variable.
Definition Minimizer.cxx:61
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:314
void SetDefaultOptions()
Reset the default options (defined in MinimizerOptions).
Definition Minimizer.h:378
bool fValidError
flag to control if errors have been validated (Hesse has been run in case of Minuit)
Definition Minimizer.h:386
virtual int MinosStatus() const
Status code of Minos (to be re-implemented by the minimizers supporting Minos).
Definition Minimizer.h:330
virtual bool SetVariableLimits(unsigned int ivar, double lower, double upper)
Set the limits of an already existing variable.
Definition Minimizer.h:216
void SetTolerance(double tol)
Set the tolerance.
Definition Minimizer.h:354
Minimizer(Minimizer const &)=delete
virtual int CovMatrixStatus() const
Definition Minimizer.h:273
virtual bool Minimize()=0
Method to perform the minimization.
int Status() const
Status code of minimizer.
Definition Minimizer.h:327
virtual bool SetVariableUpperLimit(unsigned int ivar, double upper)
Set the upper-limit of an already existing variable.
Definition Minimizer.cxx:86
virtual bool SetCovariance(std::span< const double > cov, unsigned int nrow)
Set initial covariance matrix.
Definition Minimizer.cxx:26
Minimizer()
Default constructor.
Definition Minimizer.h:129
virtual std::string VariableName(unsigned int ivar) const
Get name of variables (override if minimizer support storing of variable names).
void SetPrintLevel(int level)
Set print level.
Definition Minimizer.h:345
virtual double CovMatrix(unsigned int ivar, unsigned int jvar) const
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:324
virtual unsigned int NCalls() const
Number of function calls to reach the minimum.
Definition Minimizer.h:245
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), leave lower bound unlimited.
Definition Minimizer.h:196
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:361
virtual bool ProvidesError() const
Minimizer provides error and error matrix.
Definition Minimizer.h:260
virtual bool FixVariable(unsigned int ivar)
Fix an existing variable.
Definition Minimizer.cxx:95
void SetPrecision(double prec)
Set in the minimizer the objective function evaluation precision.
Definition Minimizer.h:358
virtual MinimizerOptions Options() const
Retrieve the minimizer options (implement derived class if needed).
Definition Minimizer.h:340
virtual double Correlation(unsigned int i, unsigned int j) const
Definition Minimizer.h:281
virtual ~Minimizer()
Destructor (no operations).
Definition Minimizer.h:132
double ErrorDef() const
Definition Minimizer.h:334
MinimizerOptions fOptions
minimizer options
Definition Minimizer.h:387
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:52
void SetMaxFunctionCalls(unsigned int maxfcn)
Set maximum of function calls.
Definition Minimizer.h:348
bool IsValidError() const
Definition Minimizer.h:337
virtual double Edm() const
Definition Minimizer.h:239
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:370
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:204
virtual void Clear()
Reset for consecutive minimization - implement if needed.
Definition Minimizer.h:141
void SetExtraOptions(const IOptions &extraOptions)
Set only the extra options.
Definition Minimizer.h:375
virtual double MinValue() const =0
int PrintLevel() const
Set print level.
Definition Minimizer.h:308
virtual void PrintResults()
Print the result according to set level (implemented for TMinuit for maintaining Minuit-style printin...
Definition Minimizer.h:299
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).
Definition Minimizer.h:257
virtual bool SetVariableLowerLimit(unsigned int ivar, double lower)
Set the lower-limit of an already existing variable.
Definition Minimizer.cxx:78
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.
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.
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...