14 #ifndef ROOT_Math_ParamFunctor 15 #define ROOT_Math_ParamFunctor 64 template<
class ParentFunctor,
class Func >
67 typedef typename ParentFunctor::EvalType
EvalType;
68 typedef typename ParentFunctor::Impl
Base;
94 inline EvalType
operator() (
const EvalType *
x,
const double *p) {
110 inline static T Eval( F & f,
T *
x,
double * p) {
115 return f((
T*)x, (
double*)p);
120 inline static T Eval( F * f,
T *
x,
double * p) {
125 return (*f)((
T*)x, (
double*)p);
131 inline static T Eval(
const F * f,
T *
x,
double * p) {
135 inline static T EvalConst(
const F * f,
const T *
x,
const double * p) {
136 return (*f)((
T*)x, (
double*)p);
144 #if defined(__MAKECINT__) || defined(G__DICTIONARY) 147 template<
class ParentFunctor>
154 double operator() (
double *,
double * ) {
return 0; }
156 double operator() (
const double *,
const double * ) {
return 0; }
171 template <
class ParentFunctor,
typename PointerToObj,
172 typename PointerToMemFn>
175 typedef typename ParentFunctor::Impl
Base;
182 : fObj(pObj), fMemFn(pMemFn)
192 return ((*fObj).*fMemFn)(
x,p);
216 inline static T Eval(PObj & pobj, F & f,
T *
x,
double * p) {
217 return ((*pobj).*f)(
x, p);
220 inline static T EvalConst(PObj & pobj, F & f,
const T *
x,
const double * p) {
221 return ((*pobj).*f)((
T*)x, (
double*)p);
292 template <
class PtrObj,
typename MemFn>
302 template <
typename Func>
310 typedef T (* FreeFunc ) (
T * ,
double *);
326 if (fImpl)
delete fImpl;
351 if (fImpl)
delete fImpl;
363 return (*fImpl)(
x,p);
367 return (*fImpl)(
x,p);
371 bool Empty()
const {
return fImpl == 0; }
ParentFunctor::EvalType EvalType
Param Functor class for Multidimensional functions.
ParamFunctorTempl(const std::function< T(const T *f, const Double_t *param)> &func)
Namespace for new ROOT classes and functions.
static T Eval(F &f, T *x, double *p)
virtual ~ParamFunctorTempl()
Destructor (no operations)
virtual ~ParamFunctionBase()
static T Eval(F *f, T *x, double *p)
ParamFunctor Handler class is responsible for wrapping any other functor and pointer to free C functi...
static T EvalConst(F *f, const T *x, const double *p)
static T Eval(PObj &pobj, F &f, T *x, double *p)
ParamFunctorTempl(const ParamFunctorTempl &rhs)
Copy constructor.
ParamFunctorTempl(FreeFunc f)
ParamMemFunHandler(const PointerToObj &pObj, PointerToMemFn pMemFn)
constructor from a pointer to the class and a pointer to the function
virtual ParamFunctionBase * Clone() const =0
ParamFunctorTempl()
Default constructor.
ParamFunctorHandler * Clone() const
virtual T operator()(const T *x, const double *p)=0
* x
Deprecated and error prone model selection interface.
ParamFunctorTempl(const Func &f)
construct from another generic Functor of multi-dimension
static T EvalConst(PObj &pobj, F &f, const T *x, const double *p)
ParamFunctorTempl(const PtrObj &p, MemFn memFn)
construct from a pointer to member function (multi-dim type)
ParamFunctor Handler to Wrap pointers to member functions.
class defining the signature for multi-dim parametric functions
ParamMemFunHandler * Clone() const
Namespace for new Math classes and functions.
virtual ~ParamMemFunHandler()
double Eval(double x, const double *c)
static T EvalConst(F &f, const T *x, const double *p)
virtual ~ParamFunctorHandler()
ParamFunctorHandler(const Func &fun)
static T Eval(const F *f, T *x, double *p)
ParamFunctionBase< T > Impl
static T EvalConst(const F *f, const T *x, const double *p)
void SetFunction(Impl *f)