Logo ROOT  
Reference Guide
 
Loading...
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);
21 acts on: Migrad (behavioural),
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
40 unsigned int GradientNCycles() const { return fGradNCyc; }
41 double GradientStepTolerance() const { return fGradTlrStp; }
42 double GradientTolerance() const { return fGradTlr; }
43
44 unsigned int HessianNCycles() const { return fHessNCyc; }
45 double HessianStepTolerance() const { return fHessTlrStp; }
46 double HessianG2Tolerance() const { return fHessTlrG2; }
47 unsigned int HessianGradientNCycles() const { return fHessGradNCyc; }
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
63 void SetGradientNCycles(unsigned int n) { fGradNCyc = n; }
64 void SetGradientStepTolerance(double stp) { fGradTlrStp = stp; }
65 void SetGradientTolerance(double toler) { fGradTlr = toler; }
66
67 void SetHessianNCycles(unsigned int n) { fHessNCyc = n; }
68 void SetHessianStepTolerance(double stp) { fHessTlrStp = stp; }
69 void SetHessianG2Tolerance(double toler) { fHessTlrG2 = toler; }
70 void SetHessianGradientNCycles(unsigned int n) { fHessGradNCyc = n; }
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
87 unsigned int fGradNCyc;
89 double fGradTlr;
90 unsigned int fHessNCyc;
92 double fHessTlrG2;
93 unsigned int fHessGradNCyc;
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
unsigned int fHessGradNCyc
Definition MnStrategy.h:93
unsigned int HessianGradientNCycles() const
Definition MnStrategy.h:47
unsigned int HessianCentralFDMixedDerivatives() const
Definition MnStrategy.h:48
double GradientStepTolerance() const
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
double GradientTolerance() const
Definition MnStrategy.h:42
void SetGradientTolerance(double toler)
Definition MnStrategy.h:65
double HessianStepTolerance() const
Definition MnStrategy.h:45
unsigned int HessianNCycles() const
Definition MnStrategy.h:44
unsigned int GradientNCycles() const
Definition MnStrategy.h:40
void SetHessianCentralFDMixedDerivatives(unsigned int flag)
Definition MnStrategy.h:74
void SetGradientNCycles(unsigned int n)
Definition MnStrategy.h:63
void SetHessianForcePosDef(unsigned int flag)
Definition MnStrategy.h:78
void SetGradientStepTolerance(double stp)
Definition MnStrategy.h:64
void SetHessianGradientNCycles(unsigned int n)
Definition MnStrategy.h:70
void SetHessianG2Tolerance(double toler)
Definition MnStrategy.h:69
const Int_t n
Definition legend1.C:16
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...