File indexing completed on 2025-01-30 10:22:11
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef ROOT_Minuit2_FCNAdapter
0011 #define ROOT_Minuit2_FCNAdapter
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 template <class Function>
0033 class FCNAdapter : public FCNBase {
0034
0035 public:
0036 FCNAdapter(const Function &f, double up = 1.) : fFunc(f), fUp(up) {}
0037
0038 ~FCNAdapter() override {}
0039
0040 double operator()(const std::vector<double> &v) const override { return fFunc.operator()(&v[0]); }
0041 double operator()(const double *v) const { return fFunc.operator()(v); }
0042 double Up() const override { return fUp; }
0043
0044 void SetErrorDef(double up) override { fUp = up; }
0045
0046
0047
0048
0049
0050
0051 private:
0052 const Function &fFunc;
0053 double fUp;
0054 };
0055
0056 }
0057
0058 }
0059
0060 #endif