14 #ifndef ROOT_Math_ParamFunctor 15 #define ROOT_Math_ParamFunctor 45 virtual double operator() (
double *
x,
double *p) = 0;
62 template<
class ParentFunctor,
class Func >
65 typedef typename ParentFunctor::Impl
Base;
103 inline static double Eval(
F &
f,
double *
x,
double * p) {
108 inline static double Eval(
F *
f,
double *
x,
double * p) {
113 inline static double Eval(
const F *
f,
double *
x,
double * p) {
121 #if defined(__MAKECINT__) || defined(G__DICTIONARY) 124 template<
class ParentFunctor>
131 double operator() (
double *,
double * ) {
return 0; }
146 template <
class ParentFunctor,
typename PointerToObj,
147 typename PointerToMemFn>
150 typedef typename ParentFunctor::Impl
Base;
157 : fObj(pObj), fMemFn(pMemFn)
167 return ((*fObj).*fMemFn)(
x,p);
175 return ((*fObj).*fMemFn)(
x,p);
226 template <
class PtrObj,
typename MemFn>
236 template <
typename Func>
244 typedef double (* FreeFunc ) (
double * ,
double *);
255 if (fImpl)
delete fImpl;
280 if (fImpl)
delete fImpl;
292 return (*fImpl)(
x,p);
297 bool Empty()
const {
return fImpl == 0; }
ParamFunctor(const ParamFunctor &rhs)
Copy constructor.
Namespace for new ROOT classes and functions.
ParamFunctor Handler class is responsible for wrapping any other functor and pointer to free C functi...
static double Eval(F &f, double *x, double *p)
virtual double operator()(double *x, double *p)=0
static double Eval(const F *f, double *x, double *p)
ParamFunctor(const Func &f)
construct from another generic Functor of multi-dimension
virtual ParamFunctionBase * Clone() const =0
virtual ~ParamFunctionBase()
ParamMemFunHandler(const PointerToObj &pObj, PointerToMemFn pMemFn)
constructor from a pointer to the class and a pointer to the function
ParamFunctor()
Default constructor.
ParamFunctorHandler * Clone() const
ParamFunctor(const PtrObj &p, MemFn memFn)
construct from a pointer to member function (multi-dim type)
virtual ~ParamFunctor()
Destructor (no operations)
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()
Binding & operator=(OUT(*fun)(void))
static double Eval(F *f, double *x, double *p)
Param Functor class for Multidimensional functions.
void SetFunction(Impl *f)
virtual ~ParamFunctorHandler()
ParamFunctorHandler(const Func &fun)