File indexing completed on 2025-01-18 10:10:25
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef ROOT_Minuit2_MnStrategy
0011 #define ROOT_Minuit2_MnStrategy
0012
0013 namespace ROOT {
0014
0015 namespace Minuit2 {
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027 class MnStrategy {
0028
0029 public:
0030
0031 MnStrategy();
0032
0033
0034 explicit MnStrategy(unsigned int);
0035
0036 ~MnStrategy() {}
0037
0038 unsigned int Strategy() const { return fStrategy; }
0039
0040 unsigned int GradientNCycles() const { return fGradNCyc; }
0041 double GradientStepTolerance() const { return fGradTlrStp; }
0042 double GradientTolerance() const { return fGradTlr; }
0043
0044 unsigned int HessianNCycles() const { return fHessNCyc; }
0045 double HessianStepTolerance() const { return fHessTlrStp; }
0046 double HessianG2Tolerance() const { return fHessTlrG2; }
0047 unsigned int HessianGradientNCycles() const { return fHessGradNCyc; }
0048 unsigned int HessianCentralFDMixedDerivatives() const { return fHessCFDG2; }
0049 unsigned int HessianForcePosDef() const { return fHessForcePosDef; }
0050
0051 int StorageLevel() const { return fStoreLevel; }
0052
0053 bool IsLow() const { return fStrategy == 0; }
0054 bool IsMedium() const { return fStrategy == 1; }
0055 bool IsHigh() const { return fStrategy == 2; }
0056 bool IsVeryHigh() const { return fStrategy >= 3; }
0057
0058 void SetLowStrategy();
0059 void SetMediumStrategy();
0060 void SetHighStrategy();
0061 void SetVeryHighStrategy();
0062
0063 void SetGradientNCycles(unsigned int n) { fGradNCyc = n; }
0064 void SetGradientStepTolerance(double stp) { fGradTlrStp = stp; }
0065 void SetGradientTolerance(double toler) { fGradTlr = toler; }
0066
0067 void SetHessianNCycles(unsigned int n) { fHessNCyc = n; }
0068 void SetHessianStepTolerance(double stp) { fHessTlrStp = stp; }
0069 void SetHessianG2Tolerance(double toler) { fHessTlrG2 = toler; }
0070 void SetHessianGradientNCycles(unsigned int n) { fHessGradNCyc = n; }
0071
0072
0073
0074 void SetHessianCentralFDMixedDerivatives(unsigned int flag) { fHessCFDG2 = flag; }
0075
0076
0077
0078 void SetHessianForcePosDef(unsigned int flag) { fHessForcePosDef = flag; }
0079
0080
0081
0082 void SetStorageLevel(unsigned int level) { fStoreLevel = level; }
0083
0084 private:
0085 unsigned int fStrategy;
0086
0087 unsigned int fGradNCyc;
0088 double fGradTlrStp;
0089 double fGradTlr;
0090 unsigned int fHessNCyc;
0091 double fHessTlrStp;
0092 double fHessTlrG2;
0093 unsigned int fHessGradNCyc;
0094 int fHessCFDG2;
0095 int fHessForcePosDef;
0096 int fStoreLevel;
0097 };
0098
0099 }
0100
0101 }
0102
0103 #endif