File indexing completed on 2025-09-18 09:31:46
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 unsigned int Strategy() const { return fStrategy; }
0037
0038 unsigned int GradientNCycles() const { return fGradNCyc; }
0039 double GradientStepTolerance() const { return fGradTlrStp; }
0040 double GradientTolerance() const { return fGradTlr; }
0041
0042 unsigned int HessianNCycles() const { return fHessNCyc; }
0043 double HessianStepTolerance() const { return fHessTlrStp; }
0044 double HessianG2Tolerance() const { return fHessTlrG2; }
0045 unsigned int HessianGradientNCycles() const { return fHessGradNCyc; }
0046 unsigned int HessianCentralFDMixedDerivatives() const { return fHessCFDG2; }
0047 unsigned int HessianForcePosDef() const { return fHessForcePosDef; }
0048
0049 int StorageLevel() const { return fStoreLevel; }
0050
0051 bool IsLow() const { return fStrategy == 0; }
0052 bool IsMedium() const { return fStrategy == 1; }
0053 bool IsHigh() const { return fStrategy == 2; }
0054 bool IsVeryHigh() const { return fStrategy >= 3; }
0055
0056 void SetLowStrategy();
0057 void SetMediumStrategy();
0058 void SetHighStrategy();
0059 void SetVeryHighStrategy();
0060
0061 void SetGradientNCycles(unsigned int n) { fGradNCyc = n; }
0062 void SetGradientStepTolerance(double stp) { fGradTlrStp = stp; }
0063 void SetGradientTolerance(double toler) { fGradTlr = toler; }
0064
0065 void SetHessianNCycles(unsigned int n) { fHessNCyc = n; }
0066 void SetHessianStepTolerance(double stp) { fHessTlrStp = stp; }
0067 void SetHessianG2Tolerance(double toler) { fHessTlrG2 = toler; }
0068 void SetHessianGradientNCycles(unsigned int n) { fHessGradNCyc = n; }
0069
0070
0071
0072 void SetHessianCentralFDMixedDerivatives(unsigned int flag) { fHessCFDG2 = flag; }
0073
0074
0075
0076 void SetHessianForcePosDef(unsigned int flag) { fHessForcePosDef = flag; }
0077
0078
0079
0080 void SetStorageLevel(unsigned int level) { fStoreLevel = level; }
0081
0082 private:
0083 unsigned int fStrategy;
0084
0085 unsigned int fGradNCyc;
0086 double fGradTlrStp;
0087 double fGradTlr;
0088 unsigned int fHessNCyc;
0089 double fHessTlrStp;
0090 double fHessTlrG2;
0091 unsigned int fHessGradNCyc;
0092 int fHessCFDG2;
0093 int fHessForcePosDef;
0094 int fStoreLevel;
0095 };
0096
0097 }
0098
0099 }
0100
0101 #endif