Minimizer options.
Class defining the options for the minimizer. It contains also static methods for setting the default Minimizer option values that will be used by default by all Minimizer instances. To see the current default options do:
ROOT::Math::MinimizerOptions::PrintDefault();
Definition at line 40 of file MinimizerOptions.h.
Public Member Functions | |
MinimizerOptions () | |
MinimizerOptions (const MinimizerOptions &opt) | |
~MinimizerOptions () | |
double | ErrorDef () const |
error definition | |
const IOptions * | ExtraOptions () const |
return extra options (NULL pointer if they are not present) | |
unsigned int | MaxFunctionCalls () const |
max number of function calls | |
unsigned int | MaxIterations () const |
max iterations | |
const std::string & | MinimizerAlgorithm () const |
type of algorithm | |
const std::string & | MinimizerType () const |
type of minimizer | |
MinimizerOptions & | operator= (const MinimizerOptions &opt) |
assignment operators | |
double | Precision () const |
precision in the objective function calculation (value <=0 means left to default) | |
void | Print (std::ostream &os=std::cout) const |
print all the options | |
int | PrintLevel () const |
non-static methods for retrieving options | |
void | ResetToDefaultOptions () |
non-static methods for setting options | |
void | SetErrorDef (double err) |
set error def | |
void | SetExtraOptions (const IOptions &opt) |
set extra options (in this case pointer is cloned) | |
void | SetMaxFunctionCalls (unsigned int maxfcn) |
set maximum of function calls | |
void | SetMaxIterations (unsigned int maxiter) |
set maximum iterations (one iteration can have many function calls) | |
void | SetMinimizerAlgorithm (const char *type) |
set minimizer algorithm | |
void | SetMinimizerType (const char *type) |
set minimizer type | |
void | SetPrecision (double prec) |
set the precision | |
void | SetPrintLevel (int level) |
set print level | |
void | SetStrategy (int stra) |
set the strategy | |
void | SetTolerance (double tol) |
set the tolerance | |
int | Strategy () const |
strategy | |
double | Tolerance () const |
absolute tolerance | |
Static Public Member Functions | |
static ROOT::Math::IOptions & | Default (const char *name) |
Retrieve extra options for a given minimizer name. | |
static double | DefaultErrorDef () |
static IOptions * | DefaultExtraOptions () |
static int | DefaultMaxFunctionCalls () |
static int | DefaultMaxIterations () |
static const std::string & | DefaultMinimizerAlgo () |
static const std::string & | DefaultMinimizerType () |
static double | DefaultPrecision () |
static int | DefaultPrintLevel () |
static int | DefaultStrategy () |
static double | DefaultTolerance () |
static ROOT::Math::IOptions * | FindDefault (const char *name) |
Find an extra options and return a nullptr if it is not existing. | |
static void | PrintDefault (const char *name=nullptr, std::ostream &os=std::cout) |
Print all the default options including the extra one specific for a given minimizer name. | |
static void | SetDefaultErrorDef (double up) |
Set the default level for computing the parameter errors. | |
static void | SetDefaultExtraOptions (const IOptions *extraoptions) |
Set additional minimizer options as pair of (string,value). | |
static void | SetDefaultMaxFunctionCalls (int maxcall) |
Set the maximum number of function calls. | |
static void | SetDefaultMaxIterations (int maxiter) |
Set the maximum number of iterations. | |
static void | SetDefaultMinimizer (const char *type, const char *algo=nullptr) |
Set the default Minimizer type and corresponding algorithms. | |
static void | SetDefaultPrecision (double prec) |
Set the default Minimizer precision. | |
static void | SetDefaultPrintLevel (int level) |
Set the default Print Level. | |
static void | SetDefaultStrategy (int strat) |
Set the default strategy. | |
static void | SetDefaultTolerance (double tol) |
Set the Minimization tolerance. | |
Private Attributes | |
std::string | fAlgoType |
Minimizer algorithmic specification (Migrad, Minimize, ...) | |
double | fErrorDef |
error definition (=1. for getting 1 sigma error for chi2 fits) | |
ROOT::Math::IOptions * | fExtraOptions |
int | fLevel |
debug print level | |
int | fMaxCalls |
maximum number of function calls | |
int | fMaxIter |
maximum number of iterations | |
std::string | fMinimType |
Minimizer type (Minuit, Minuit2, etc.. | |
double | fPrecision |
precision of the objective function evaluation (value <=0 means left to default) | |
int | fStrategy |
minimizer strategy (used by Minuit) | |
double | fTolerance |
minimize tolerance to reach solution | |
#include <Math/MinimizerOptions.h>
ROOT::Math::MinimizerOptions::MinimizerOptions | ( | ) |
Definition at line 133 of file MinimizerOptions.cxx.
ROOT::Math::MinimizerOptions::~MinimizerOptions | ( | ) |
Definition at line 166 of file MinimizerOptions.cxx.
ROOT::Math::MinimizerOptions::MinimizerOptions | ( | const MinimizerOptions & | opt | ) |
Definition at line 142 of file MinimizerOptions.cxx.
|
static |
Retrieve extra options for a given minimizer name.
If the extra options already exist in a global map of (Minimizer name, options) it will return a reference to that options, otherwise it will create a new one and return the corresponding reference
Definition at line 230 of file MinimizerOptions.cxx.
|
static |
Definition at line 91 of file MinimizerOptions.cxx.
|
static |
Definition at line 98 of file MinimizerOptions.cxx.
|
static |
Definition at line 94 of file MinimizerOptions.cxx.
|
static |
Definition at line 95 of file MinimizerOptions.cxx.
|
static |
Definition at line 85 of file MinimizerOptions.cxx.
|
static |
Definition at line 100 of file MinimizerOptions.cxx.
|
static |
Definition at line 93 of file MinimizerOptions.cxx.
|
static |
Definition at line 97 of file MinimizerOptions.cxx.
|
static |
Definition at line 96 of file MinimizerOptions.cxx.
|
static |
Definition at line 92 of file MinimizerOptions.cxx.
|
inline |
error definition
Definition at line 192 of file MinimizerOptions.h.
|
inline |
return extra options (NULL pointer if they are not present)
Definition at line 195 of file MinimizerOptions.h.
|
static |
Find an extra options and return a nullptr if it is not existing.
Same as above but it will not create a new one
Definition at line 235 of file MinimizerOptions.cxx.
|
inline |
max number of function calls
Definition at line 177 of file MinimizerOptions.h.
|
inline |
max iterations
Definition at line 180 of file MinimizerOptions.h.
|
inline |
type of algorithm
Definition at line 201 of file MinimizerOptions.h.
|
inline |
type of minimizer
Definition at line 198 of file MinimizerOptions.h.
MinimizerOptions & ROOT::Math::MinimizerOptions::operator= | ( | const MinimizerOptions & | opt | ) |
assignment operators
Definition at line 147 of file MinimizerOptions.cxx.
|
inline |
precision in the objective function calculation (value <=0 means left to default)
Definition at line 189 of file MinimizerOptions.h.
void ROOT::Math::MinimizerOptions::Print | ( | std::ostream & | os = std::cout | ) | const |
print all the options
Definition at line 212 of file MinimizerOptions.cxx.
|
static |
Print all the default options including the extra one specific for a given minimizer name.
If no minimizer name is given, all the extra default options, which have been set and configured will be printed
Definition at line 240 of file MinimizerOptions.cxx.
|
inline |
non-static methods for retrieving options
set print level
Definition at line 174 of file MinimizerOptions.h.
void ROOT::Math::MinimizerOptions::ResetToDefaultOptions | ( | ) |
non-static methods for setting options
Definition at line 170 of file MinimizerOptions.cxx.
|
static |
Set the default level for computing the parameter errors.
For example for 1-sigma parameter errors
The value will be used also by Minos when computing the confidence interval
Definition at line 51 of file MinimizerOptions.cxx.
|
static |
Set additional minimizer options as pair of (string,value).
Extra option defaults can be configured for a specific algorithm and then if a matching with the correct option name exists it will be used whenever creating a new minimizer instance. For example for changing the default number of steps of the Genetic minimizer from 100 to 500 do
auto extraOpt = ROOT::Math::MinimizerOptions::Default("Genetic") extraOpts.SetValue("Steps",500);
and when creating the Genetic minimizer you will have the new value for the option:
auto gmin = ROOT::Math::Factory::CreateMinimizer("Genetic"); gmin->Options().Print();
Definition at line 79 of file MinimizerOptions.cxx.
|
static |
Set the maximum number of function calls.
Definition at line 63 of file MinimizerOptions.cxx.
|
static |
Set the maximum number of iterations.
Used by the GSL minimizers and Genetic. Not used by Minuit,Minuit2.
Definition at line 67 of file MinimizerOptions.cxx.
|
static |
Set the default Minimizer type and corresponding algorithms.
Here is the list of the available minimizers and their corresponding algorithms. For some minimizers (e.g. Fumili) there are no specific algorithms available, then there is no need to specify it.
Definition at line 43 of file MinimizerOptions.cxx.
|
static |
Set the default Minimizer precision.
(used only by MInuit and Minuit2) It is used to specify the numerical precision used for computing the objective function. It should be left to the default value found by the Minimizer (typically double precision)
Definition at line 59 of file MinimizerOptions.cxx.
|
static |
Set the default Print Level.
Possible levels are from 0 (minimal printing) to 3 (maximum printing)
Definition at line 75 of file MinimizerOptions.cxx.
|
static |
Set the default strategy.
The strategy is a parameter used only by Minuit and Minuit2. Possible values are:
strat = 0
: rough approximation of Hessian using the gradient. Avoid computing the full Hessian matrixstrat = 1
(default and recommended one) - Use Hessian approximation but compute full Hessian at the end of minimization if needed.strat = 2
Perform several full Hessian computations during the minimization. Slower and not always working better than strat=1
. Definition at line 71 of file MinimizerOptions.cxx.
|
static |
Set the Minimization tolerance.
The Default value for Minuit and Minuit2 is 0.01
Definition at line 55 of file MinimizerOptions.cxx.
|
inline |
set error def
Definition at line 228 of file MinimizerOptions.h.
void ROOT::Math::MinimizerOptions::SetExtraOptions | ( | const IOptions & | opt | ) |
set extra options (in this case pointer is cloned)
Definition at line 206 of file MinimizerOptions.cxx.
|
inline |
set maximum of function calls
Definition at line 213 of file MinimizerOptions.h.
|
inline |
set maximum iterations (one iteration can have many function calls)
Definition at line 216 of file MinimizerOptions.h.
|
inline |
set minimizer algorithm
Definition at line 234 of file MinimizerOptions.h.
|
inline |
set minimizer type
Definition at line 231 of file MinimizerOptions.h.
|
inline |
set the precision
Definition at line 222 of file MinimizerOptions.h.
|
inline |
set print level
Definition at line 210 of file MinimizerOptions.h.
|
inline |
set the strategy
Definition at line 225 of file MinimizerOptions.h.
|
inline |
set the tolerance
Definition at line 219 of file MinimizerOptions.h.
|
inline |
strategy
Definition at line 183 of file MinimizerOptions.h.
|
inline |
absolute tolerance
Definition at line 186 of file MinimizerOptions.h.
|
private |
Minimizer algorithmic specification (Migrad, Minimize, ...)
Definition at line 250 of file MinimizerOptions.h.
|
private |
error definition (=1. for getting 1 sigma error for chi2 fits)
Definition at line 246 of file MinimizerOptions.h.
|
private |
Definition at line 253 of file MinimizerOptions.h.
|
private |
debug print level
Definition at line 242 of file MinimizerOptions.h.
|
private |
maximum number of function calls
Definition at line 243 of file MinimizerOptions.h.
|
private |
maximum number of iterations
Definition at line 244 of file MinimizerOptions.h.
|
private |
Minimizer type (Minuit, Minuit2, etc..
Definition at line 249 of file MinimizerOptions.h.
|
private |
precision of the objective function evaluation (value <=0 means left to default)
Definition at line 248 of file MinimizerOptions.h.
|
private |
minimizer strategy (used by Minuit)
Definition at line 245 of file MinimizerOptions.h.
|
private |
minimize tolerance to reach solution
Definition at line 247 of file MinimizerOptions.h.