14#ifndef ROOT_Math_ParamFunctor
15#define ROOT_Math_ParamFunctor
63template<
class ParentFunctor,
class Func >
66 typedef typename ParentFunctor::EvalType
EvalType;
67 typedef typename ParentFunctor::Impl
Base;
114 return f((T*)
x, (
double*)
p);
124 return (*
f)((T*)
x, (
double*)
p);
130 inline static T
Eval(
const F *
f, T *
x,
double *
p) {
135 return (*
f)((T*)
x, (
double*)
p);
143#if defined(__MAKECINT__) || defined(G__DICTIONARY)
146template<
class ParentFunctor>
147class ParamFunctorHandler<ParentFunctor,
TRootIOCtor *> :
public ParentFunctor::Impl
153 double operator() (
double *,
double * ) {
return 0; }
155 double operator() (
const double *,
const double * ) {
return 0; }
157 ParamFunctorHandler * Clone()
const {
170template <
class ParentFunctor,
typename PointerToObj,
171 typename PointerToMemFn>
174 typedef typename ParentFunctor::Impl
Base;
215 inline static T
Eval(PObj & pobj,
F &
f, T *
x,
double *
p) {
216 return ((*pobj).*
f)(
x,
p);
219 inline static T
EvalConst(PObj & pobj,
F &
f,
const T *
x,
const double *
p) {
220 return ((*pobj).*
f)((T*)
x, (
double*)
p);
291 template <
class PtrObj,
typename MemFn>
301 template <
typename Func>
winID h TVirtualViewer3D TVirtualGLPainter p
TRObject operator()(const T1 &t1) const
class defining the signature for multi-dim parametric functions
virtual T operator()(const T *x, const double *p)=0
virtual ~ParamFunctionBase()
virtual ParamFunctionBase * Clone() const =0
ParamFunctor Handler class is responsible for wrapping any other functor and pointer to free C functi...
EvalType operator()(EvalType x, double *p)
ParentFunctor::EvalType EvalType
virtual ~ParamFunctorHandler()
ParamFunctorHandler(const Func &fun)
ParamFunctorHandler * Clone() const
Param Functor class for Multidimensional functions.
ParamFunctorTempl(const ParamFunctorTempl &rhs)
Copy constructor.
ParamFunctorTempl(const Func &f)
construct from another generic Functor of multi-dimension
void SetFunction(Impl *f)
ParamFunctorTempl()
Default constructor.
ParamFunctorTempl(const PtrObj &p, MemFn memFn)
construct from a pointer to member function (multi-dim type)
ParamFunctorTempl(FreeFunc f)
ParamFunctorTempl(const std::function< T(const T *f, const Double_t *param)> &func)
T operator()(T *x, double *p)
virtual ~ParamFunctorTempl()
Destructor (no operations)
T(* FreeFunc)(T *, double *)
ParamFunctionBase< T > Impl
ParamFunctorTempl & operator=(const ParamFunctorTempl &rhs)
Assignment operator.
ParamFunctor Handler to Wrap pointers to member functions.
ParamMemFunHandler * Clone() const
double operator()(double x, double *p)
ParamMemFunHandler & operator=(const ParamMemFunHandler &)
virtual ~ParamMemFunHandler()
ParamMemFunHandler(const ParamMemFunHandler &)
ParamMemFunHandler(const PointerToObj &pObj, PointerToMemFn pMemFn)
constructor from a pointer to the class and a pointer to the function
Namespace for new Math classes and functions.
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.
static T EvalConst(F *f, const T *x, const double *p)
static T Eval(F *f, T *x, double *p)
static T EvalConst(const F *f, const T *x, const double *p)
static T Eval(const F *f, T *x, double *p)
static T EvalConst(F &f, const T *x, const double *p)
static T Eval(F &f, T *x, double *p)
static T EvalConst(PObj &pobj, F &f, const T *x, const double *p)
static T Eval(PObj &pobj, F &f, T *x, double *p)