13 #ifndef ROOT_Math_OneDimFunctionAdapter 14 #define ROOT_Math_OneDimFunctionAdapter 28 template<
class MultiFuncType>
31 static double F (MultiFuncType
f,
const double *
x,
const double * = 0 ) {
55 template <
class MultiFuncType = const ROOT::Math::IMultiGenFunction &>
67 fX( const_cast<double *>(x) ),
103 std::copy(fX, fX+fDim, f->
fX);
116 template<
class Iterator>
117 void SetX(Iterator begin, Iterator end) {
118 if (fOwn) std::copy(begin, end, fX);
133 if (fOwn) std::copy(x, x+fDim, fX);
135 SetX( const_cast<double *>(x) );
144 fParams(rhs.fParams),
150 fX =
new double[fDim];
151 std::copy( rhs.
fX, rhs.
fX+fDim, fX);
161 if (
this == &rhs)
return *
this;
178 double xprev = fX[fCoord];
212 template <
class ParamFuncType = ROOT::Math::IParamMultiFunction &>
228 assert(fParams != 0);
253 double * p =
const_cast<double *
>(fParams);
254 double pprev = fParams[fIpar];
256 double y = fFunc( fX, p );
Interface (abstract class) for generic functions objects of one-dimension Provides a method to evalua...
static double F(MultiFuncType f, const double *x, const double *=0)
Namespace for new ROOT classes and functions.
double DoEval(double x) const
evaluate function at the values x[] given in the constructor and as function of the coordinate fCoord...
virtual ~OneDimMultiFunctionAdapter()
Destructor (no operations)
static double F(const ROOT::Math::IParamMultiFunction &f, const double *x, const double *p=0)
OneDimMultiFunctionAdapter class to wrap a multidimensional function in one dimensional one...
virtual OneDimMultiFunctionAdapter * Clone() const
clone
~OneDimParamFunctionAdapter()
Destructor (no operations)
OneDimMultiFunctionAdapter(MultiFuncType f, const double *x, unsigned int icoord=0, const double *p=0)
Constructor from the function object , pointer to an external array of x values and coordinate we wan...
OneDimMultiFunctionAdapter(const OneDimMultiFunctionAdapter &rhs)
OneDimMultiFunctionAdapter(MultiFuncType f, unsigned int dim=1, unsigned int icoord=0, const double *p=0)
Constructor from the function object , dimension of the function and and coordinate we want to adapt...
OneDimParamFunctionAdapter class to wrap a multi-dim parameteric function in one dimensional one...
void SetX(const double *x)
set values
double DoEval(double x) const
evaluate function at the values x[] given in the constructor and as function of the coordinate fCoord...
void SetX(Iterator begin, Iterator end)
Set X values in case vector is own, iterator size must match previous set dimension.
Namespace for new Math classes and functions.
void SetX(double *x)
set pointer without copying the values
Binding & operator=(OUT(*fun)(void))
void SetCoord(int icoord)
virtual OneDimParamFunctionAdapter * Clone() const
clone
OneDimParamFunctionAdapter(ParamFuncType f, const double *x, const double *p, unsigned int ipar=0)
Constructor from the function object , x value and coordinate we want to adapt.