Logo ROOT   6.18/05
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
13namespace 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
28
29public:
30
31 //default strategy
32 MnStrategy();
33
34 //user defined strategy (0, 1, >=2)
35 explicit MnStrategy(unsigned int);
36
38
39 unsigned int Strategy() const {return fStrategy;}
40
41 unsigned int GradientNCycles() const {return fGradNCyc;}
42 double GradientStepTolerance() const {return fGradTlrStp;}
43 double GradientTolerance() const {return fGradTlr;}
44
45 unsigned int HessianNCycles() const {return fHessNCyc;}
46 double HessianStepTolerance() const {return fHessTlrStp;}
47 double HessianG2Tolerance() const {return fHessTlrG2;}
48 unsigned int HessianGradientNCycles() const {return fHessGradNCyc;}
49
50 int StorageLevel() const { return fStoreLevel; }
51
52 bool IsLow() const {return fStrategy == 0;}
53 bool IsMedium() const {return fStrategy == 1;}
54 bool IsHigh() const {return fStrategy >= 2;}
55
56 void SetLowStrategy();
57 void SetMediumStrategy();
58 void SetHighStrategy();
59
60 void SetGradientNCycles(unsigned int n) {fGradNCyc = n;}
61 void SetGradientStepTolerance(double stp) {fGradTlrStp = stp;}
62 void SetGradientTolerance(double toler) {fGradTlr = toler;}
63
64 void SetHessianNCycles(unsigned int n) {fHessNCyc = n;}
65 void SetHessianStepTolerance(double stp) {fHessTlrStp = stp;}
66 void SetHessianG2Tolerance(double toler) {fHessTlrG2 = toler;}
68
69 // set storage level of iteration quantities
70 // 0 = store only last iterations 1 = full storage (default)
71 void SetStorageLevel(unsigned int level) { fStoreLevel = level; }
72private:
73
74 unsigned int fStrategy;
75
76 unsigned int fGradNCyc;
78 double fGradTlr;
79 unsigned int fHessNCyc;
81 double fHessTlrG2;
82 unsigned int fHessGradNCyc;
84};
85
86 } // namespace Minuit2
87
88} // namespace ROOT
89
90#endif // ROOT_Minuit2_MnStrategy
API class for defining three levels of strategies: low (0), medium (1), high (>=2); acts on: Migrad (...
Definition: MnStrategy.h:27
double HessianG2Tolerance() const
Definition: MnStrategy.h:47
unsigned int Strategy() const
Definition: MnStrategy.h:39
unsigned int fStrategy
Definition: MnStrategy.h:74
unsigned int fHessGradNCyc
Definition: MnStrategy.h:82
unsigned int HessianGradientNCycles() const
Definition: MnStrategy.h:48
double GradientStepTolerance() const
Definition: MnStrategy.h:42
void SetStorageLevel(unsigned int level)
Definition: MnStrategy.h:71
int StorageLevel() const
Definition: MnStrategy.h:50
unsigned int fHessNCyc
Definition: MnStrategy.h:79
void SetHessianNCycles(unsigned int n)
Definition: MnStrategy.h:64
void SetHessianStepTolerance(double stp)
Definition: MnStrategy.h:65
double GradientTolerance() const
Definition: MnStrategy.h:43
void SetGradientTolerance(double toler)
Definition: MnStrategy.h:62
double HessianStepTolerance() const
Definition: MnStrategy.h:46
unsigned int HessianNCycles() const
Definition: MnStrategy.h:45
unsigned int GradientNCycles() const
Definition: MnStrategy.h:41
void SetGradientNCycles(unsigned int n)
Definition: MnStrategy.h:60
unsigned int fGradNCyc
Definition: MnStrategy.h:76
void SetGradientStepTolerance(double stp)
Definition: MnStrategy.h:61
void SetHessianGradientNCycles(unsigned int n)
Definition: MnStrategy.h:67
void SetHessianG2Tolerance(double toler)
Definition: MnStrategy.h:66
const Int_t n
Definition: legend1.C:16
Namespace for new ROOT classes and functions.
Definition: StringConv.hxx:21