Logo ROOT  
Reference Guide
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 
13 namespace ROOT {
14 
15 namespace Minuit2 {
16 
17 //_________________________________________________________________________
18 /**
19  API class for defining three levels of strategies: low (0), medium (1),
20  high (>=2);
21  acts on: Migrad (behavioural),
22  Minos (lowers strategy by 1 for Minos-own minimization),
23  Hesse (iterations),
24  Numerical2PDerivative (iterations)
25  */
26 
27 class MnStrategy {
28 
29 public:
30  // default strategy
31  MnStrategy();
32 
33  // user defined strategy (0, 1, >=2)
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 
49  int StorageLevel() const { return fStoreLevel; }
50 
51  bool IsLow() const { return fStrategy == 0; }
52  bool IsMedium() const { return fStrategy == 1; }
53  bool IsHigh() const { return fStrategy >= 2; }
54 
55  void SetLowStrategy();
56  void SetMediumStrategy();
57  void SetHighStrategy();
58 
59  void SetGradientNCycles(unsigned int n) { fGradNCyc = n; }
60  void SetGradientStepTolerance(double stp) { fGradTlrStp = stp; }
61  void SetGradientTolerance(double toler) { fGradTlr = toler; }
62 
63  void SetHessianNCycles(unsigned int n) { fHessNCyc = n; }
64  void SetHessianStepTolerance(double stp) { fHessTlrStp = stp; }
65  void SetHessianG2Tolerance(double toler) { fHessTlrG2 = toler; }
66  void SetHessianGradientNCycles(unsigned int n) { fHessGradNCyc = n; }
67 
68  // set storage level of iteration quantities
69  // 0 = store only last iterations 1 = full storage (default)
70  void SetStorageLevel(unsigned int level) { fStoreLevel = level; }
71 
72 private:
73  unsigned int fStrategy;
74 
75  unsigned int fGradNCyc;
76  double fGradTlrStp;
77  double fGradTlr;
78  unsigned int fHessNCyc;
79  double fHessTlrStp;
80  double fHessTlrG2;
81  unsigned int fHessGradNCyc;
83 };
84 
85 } // namespace Minuit2
86 
87 } // namespace ROOT
88 
89 #endif // ROOT_Minuit2_MnStrategy
n
const Int_t n
Definition: legend1.C:16
ROOT::Minuit2::MnStrategy::Strategy
unsigned int Strategy() const
Definition: MnStrategy.h:38
ROOT::Minuit2::MnStrategy::fHessTlrStp
double fHessTlrStp
Definition: MnStrategy.h:79
ROOT::Minuit2::MnStrategy::HessianStepTolerance
double HessianStepTolerance() const
Definition: MnStrategy.h:45
ROOT::Minuit2::MnStrategy::SetHessianG2Tolerance
void SetHessianG2Tolerance(double toler)
Definition: MnStrategy.h:65
ROOT::Minuit2::MnStrategy::SetLowStrategy
void SetLowStrategy()
Definition: MnStrategy.cxx:33
ROOT::Minuit2::MnStrategy::IsHigh
bool IsHigh() const
Definition: MnStrategy.h:53
ROOT::Minuit2::MnStrategy::fHessGradNCyc
unsigned int fHessGradNCyc
Definition: MnStrategy.h:81
ROOT::Minuit2::MnStrategy::MnStrategy
MnStrategy()
Definition: MnStrategy.cxx:16
ROOT::Minuit2::MnStrategy::GradientNCycles
unsigned int GradientNCycles() const
Definition: MnStrategy.h:40
ROOT::Minuit2::MnStrategy::SetHessianGradientNCycles
void SetHessianGradientNCycles(unsigned int n)
Definition: MnStrategy.h:66
ROOT::Minuit2::MnStrategy::IsLow
bool IsLow() const
Definition: MnStrategy.h:51
ROOT::Minuit2::MnStrategy::GradientTolerance
double GradientTolerance() const
Definition: MnStrategy.h:42
ROOT::Minuit2::MnStrategy::GradientStepTolerance
double GradientStepTolerance() const
Definition: MnStrategy.h:41
ROOT::Minuit2::MnStrategy::SetGradientStepTolerance
void SetGradientStepTolerance(double stp)
Definition: MnStrategy.h:60
ROOT::Minuit2::MnStrategy::fGradTlrStp
double fGradTlrStp
Definition: MnStrategy.h:76
ROOT::Minuit2::MnStrategy::fHessTlrG2
double fHessTlrG2
Definition: MnStrategy.h:80
ROOT::Minuit2::MnStrategy::HessianNCycles
unsigned int HessianNCycles() const
Definition: MnStrategy.h:44
ROOT::Minuit2::MnStrategy::SetHessianStepTolerance
void SetHessianStepTolerance(double stp)
Definition: MnStrategy.h:64
ROOT::Minuit2::MnStrategy::SetGradientTolerance
void SetGradientTolerance(double toler)
Definition: MnStrategy.h:61
ROOT::Minuit2::MnStrategy::StorageLevel
int StorageLevel() const
Definition: MnStrategy.h:49
ROOT::Minuit2::MnStrategy::fGradTlr
double fGradTlr
Definition: MnStrategy.h:77
ROOT::Minuit2::MnStrategy::fStoreLevel
int fStoreLevel
Definition: MnStrategy.h:82
ROOT::Minuit2::MnStrategy::HessianG2Tolerance
double HessianG2Tolerance() const
Definition: MnStrategy.h:46
ROOT::Minuit2::MnStrategy::fHessNCyc
unsigned int fHessNCyc
Definition: MnStrategy.h:78
ROOT::Minuit2::MnStrategy::IsMedium
bool IsMedium() const
Definition: MnStrategy.h:52
ROOT::Minuit2::MnStrategy::fGradNCyc
unsigned int fGradNCyc
Definition: MnStrategy.h:75
ROOT::Minuit2::MnStrategy::fStrategy
unsigned int fStrategy
Definition: MnStrategy.h:73
ROOT::Minuit2::MnStrategy::~MnStrategy
~MnStrategy()
Definition: MnStrategy.h:36
ROOT::Minuit2::MnStrategy::SetHighStrategy
void SetHighStrategy()
Definition: MnStrategy.cxx:59
ROOT::Minuit2::MnStrategy
API class for defining three levels of strategies: low (0), medium (1), high (>=2); acts on: Migrad (...
Definition: MnStrategy.h:27
ROOT::Minuit2::MnStrategy::HessianGradientNCycles
unsigned int HessianGradientNCycles() const
Definition: MnStrategy.h:47
ROOT::Minuit2::MnStrategy::SetStorageLevel
void SetStorageLevel(unsigned int level)
Definition: MnStrategy.h:70
ROOT::Minuit2::MnStrategy::SetHessianNCycles
void SetHessianNCycles(unsigned int n)
Definition: MnStrategy.h:63
ROOT
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Definition: EExecutionPolicy.hxx:4
ROOT::Minuit2::MnStrategy::SetMediumStrategy
void SetMediumStrategy()
Definition: MnStrategy.cxx:46
ROOT::Minuit2::MnStrategy::SetGradientNCycles
void SetGradientNCycles(unsigned int n)
Definition: MnStrategy.h:59