/usr/include/root/Fit/FcnAdapter.h is in libroot-math-mathcore-dev 5.34.14-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | // @(#)root/minuit2:$Id$
// Author: L. Moneta 10/2005
/**********************************************************************
* *
* Copyright (c) 2005 ROOT Foundation, CERN/PH-SFT *
* *
**********************************************************************/
#ifndef ROOT_Fit_FcnAdapter_H_
#define ROOT_Fit_FcnAdapter_H_
#ifndef ROOT_Math_IFunction
#include "Math/IFunction.h"
#endif
//___________________________________________________________
//
// Adapt the interface used in TMinuit (and the TVirtualFitter) for
// passing the objective function in a IFunction interface
// (ROOT::Math::IMultiGenFunction)
//
namespace ROOT {
namespace Fit {
class FcnAdapter : public ROOT::Math::IMultiGenFunction {
public:
FcnAdapter(void (*fcn)(int&, double*, double&, double*, int ), int dim = 0) :
fDim(dim),
fFCN(fcn)
{}
virtual ~FcnAdapter() {}
virtual unsigned int NDim() const { return fDim; }
ROOT::Math::IMultiGenFunction * Clone() const {
return new FcnAdapter(fFCN,fDim);
}
void SetDimension(int dim) { fDim = dim; }
private:
virtual double DoEval(const double * x) const {
double fval = 0;
int dim = fDim;
// call with flag 4
fFCN(dim, 0, fval, const_cast<double *>(x), 4);
return fval;
}
private:
unsigned int fDim;
void (*fFCN)(int&, double*, double&, double*, int);
};
} // end namespace Fit
} // end namespace ROOT
#endif //ROOT_Fit_FcnAdapter
|