File indexing completed on 2025-01-18 10:10:24
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef ROOT_Minuit2_MnApplication
0011 #define ROOT_Minuit2_MnApplication
0012
0013 #include "Minuit2/MnUserParameterState.h"
0014 #include "Minuit2/MnStrategy.h"
0015
0016 #include <vector>
0017
0018 namespace ROOT {
0019
0020 namespace Minuit2 {
0021
0022 class FunctionMinimum;
0023 class MinuitParameter;
0024 class MnMachinePrecision;
0025 class ModularFunctionMinimizer;
0026 class FCNBase;
0027 class FCNGradientBase;
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037 class MnApplication {
0038
0039 public:
0040
0041 MnApplication(const FCNBase &fcn, const MnUserParameterState &state, const MnStrategy &stra, unsigned int nfcn = 0);
0042
0043
0044 MnApplication(const FCNGradientBase &fcn, const MnUserParameterState &state, const MnStrategy &stra,
0045 unsigned int nfcn = 0);
0046
0047 virtual ~MnApplication() {}
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058 virtual FunctionMinimum operator()(unsigned int maxfcn = 0, double tolerance = 0.1);
0059
0060 virtual ModularFunctionMinimizer &Minimizer() = 0;
0061 virtual const ModularFunctionMinimizer &Minimizer() const = 0;
0062
0063 const MnMachinePrecision &Precision() const { return fState.Precision(); }
0064 const MnUserParameterState &State() const { return fState; }
0065 const MnUserParameters &Parameters() const { return fState.Parameters(); }
0066 const MnUserCovariance &Covariance() const { return fState.Covariance(); }
0067 virtual const FCNBase &Fcnbase() const { return fFCN; }
0068 const MnStrategy &Strategy() const { return fStrategy; }
0069 unsigned int NumOfCalls() const { return fNumCall; }
0070
0071 protected:
0072 const FCNBase &fFCN;
0073 MnUserParameterState fState;
0074 MnStrategy fStrategy;
0075 unsigned int fNumCall;
0076 bool fUseGrad;
0077
0078 public:
0079
0080
0081
0082
0083 const std::vector<ROOT::Minuit2::MinuitParameter> &MinuitParameters() const;
0084
0085 std::vector<double> Params() const;
0086 std::vector<double> Errors() const;
0087
0088
0089 const MinuitParameter &Parameter(unsigned int i) const;
0090
0091
0092 void Add(const char *Name, double val, double err);
0093
0094 void Add(const char *Name, double val, double err, double, double);
0095
0096 void Add(const char *, double);
0097
0098
0099 void Fix(unsigned int);
0100 void Release(unsigned int);
0101 void SetValue(unsigned int, double);
0102 void SetError(unsigned int, double);
0103 void SetLimits(unsigned int, double, double);
0104 void RemoveLimits(unsigned int);
0105
0106 double Value(unsigned int) const;
0107 double Error(unsigned int) const;
0108
0109
0110 void Fix(const char *);
0111 void Release(const char *);
0112 void SetValue(const char *, double);
0113 void SetError(const char *, double);
0114 void SetLimits(const char *, double, double);
0115 void RemoveLimits(const char *);
0116 void SetPrecision(double);
0117
0118 double Value(const char *) const;
0119 double Error(const char *) const;
0120
0121
0122 unsigned int Index(const char *) const;
0123
0124 const char *Name(unsigned int) const;
0125
0126
0127 double Int2ext(unsigned int, double) const;
0128 double Ext2int(unsigned int, double) const;
0129 unsigned int IntOfExt(unsigned int) const;
0130 unsigned int ExtOfInt(unsigned int) const;
0131 unsigned int VariableParameters() const;
0132 };
0133
0134 }
0135
0136 }
0137
0138 #endif