File indexing completed on 2025-01-30 10:22:11
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef ROOT_Minuit2_FCNGradientBase
0011 #define ROOT_Minuit2_FCNGradientBase
0012
0013 #include "Minuit2/FCNBase.h"
0014
0015 #include <vector>
0016
0017 namespace ROOT {
0018
0019 namespace Minuit2 {
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034 enum class GradientParameterSpace {
0035 External, Internal
0036 };
0037
0038 class FCNGradientBase : public FCNBase {
0039
0040 public:
0041 ~FCNGradientBase() override {}
0042
0043 virtual std::vector<double> Gradient(const std::vector<double> &) const = 0;
0044 virtual std::vector<double> GradientWithPrevResult(const std::vector<double> ¶meters, double * ,
0045 double * , double * ) const
0046 {
0047 return Gradient(parameters);
0048 };
0049
0050 virtual bool CheckGradient() const { return true; }
0051
0052 virtual GradientParameterSpace gradParameterSpace() const {
0053 return GradientParameterSpace::External;
0054 };
0055
0056
0057 virtual std::vector<double> G2(const std::vector<double> &) const { return std::vector<double>();}
0058
0059
0060 virtual std::vector<double> Hessian(const std::vector<double> &) const { return std::vector<double>();}
0061
0062 virtual bool HasHessian() const { return false; }
0063
0064 virtual bool HasG2() const { return false; }
0065
0066
0067 };
0068
0069 }
0070
0071 }
0072
0073 #endif