ROOT   Reference Guide
Searching...
No Matches
MnStrategy.h
Go to the documentation of this file.
1// @(#)root/minuit2:$Id$
2// Authors: M. Winkler, F. James, L. Moneta, A. Zsenei 2003-2005
3
4/**********************************************************************
5 * *
6 * Copyright (c) 2005 LCG ROOT Math team, CERN/PH-SFT *
7 * *
8 **********************************************************************/
9
10#ifndef ROOT_Minuit2_MnStrategy
11#define ROOT_Minuit2_MnStrategy
12
13namespace ROOT {
14
15namespace Minuit2 {
16
17//_________________________________________________________________________
18/**
19 API class for defining four levels of strategies: low (0), medium (1),
20 high (2), very high (>=3);
22 Minos (lowers strategy by 1 for Minos-own minimization),
23 Hesse (iterations),
24 Numerical2PDerivative (iterations)
25 */
26
28
29public:
30 // default strategy
31 MnStrategy();
32
33 // user defined strategy (0, 1, 2, >=3)
34 explicit MnStrategy(unsigned int);
35
37
38 unsigned int Strategy() const { return fStrategy; }
39
43
44 unsigned int HessianNCycles() const { return fHessNCyc; }
45 double HessianStepTolerance() const { return fHessTlrStp; }
46 double HessianG2Tolerance() const { return fHessTlrG2; }
48 unsigned int HessianCentralFDMixedDerivatives() const { return fHessCFDG2; }
49 unsigned int HessianForcePosDef() const { return fHessForcePosDef; }
50
51 int StorageLevel() const { return fStoreLevel; }
52
53 bool IsLow() const { return fStrategy == 0; }
54 bool IsMedium() const { return fStrategy == 1; }
55 bool IsHigh() const { return fStrategy == 2; }
56 bool IsVeryHigh() const { return fStrategy >= 3; }
57
58 void SetLowStrategy();
59 void SetMediumStrategy();
60 void SetHighStrategy();
62
66
67 void SetHessianNCycles(unsigned int n) { fHessNCyc = n; }
68 void SetHessianStepTolerance(double stp) { fHessTlrStp = stp; }
69 void SetHessianG2Tolerance(double toler) { fHessTlrG2 = toler; }
71
72 // 1 = calculate central finite difference mixed derivatives (involves 3 extra evaluations per derivative)
73 // 0 = use forward finite difference (default)
74 void SetHessianCentralFDMixedDerivatives(unsigned int flag) { fHessCFDG2 = flag; }
75
76 // 1 = returned matrix from Hesse should be forced positive definite (default)
77 // 0 = do not force matrix positive definite
78 void SetHessianForcePosDef(unsigned int flag) { fHessForcePosDef = flag; }
79
80 // set storage level of iteration quantities
81 // 0 = store only last iterations 1 = full storage (default)
82 void SetStorageLevel(unsigned int level) { fStoreLevel = level; }
83
84private:
85 unsigned int fStrategy;
86
90 unsigned int fHessNCyc;
92 double fHessTlrG2;
97};
98
99} // namespace Minuit2
100
101} // namespace ROOT
102
103#endif // ROOT_Minuit2_MnStrategy
API class for defining four levels of strategies: low (0), medium (1), high (2), very high (>=3); act...
Definition MnStrategy.h:27
double HessianG2Tolerance() const
Definition MnStrategy.h:46
unsigned int Strategy() const
Definition MnStrategy.h:38
Definition MnStrategy.h:93
Definition MnStrategy.h:47
unsigned int HessianCentralFDMixedDerivatives() const
Definition MnStrategy.h:48
Definition MnStrategy.h:41
void SetStorageLevel(unsigned int level)
Definition MnStrategy.h:82
void SetHessianNCycles(unsigned int n)
Definition MnStrategy.h:67
unsigned int HessianForcePosDef() const
Definition MnStrategy.h:49
void SetHessianStepTolerance(double stp)
Definition MnStrategy.h:68
Definition MnStrategy.h:42
Definition MnStrategy.h:65
double HessianStepTolerance() const
Definition MnStrategy.h:45
unsigned int HessianNCycles() const
Definition MnStrategy.h:44
Definition MnStrategy.h:40
void SetHessianCentralFDMixedDerivatives(unsigned int flag)
Definition MnStrategy.h:74