13 #ifndef ROOT_Math_WrappedParamFunction
14 #define ROOT_Math_WrappedParamFunction
16 #ifndef ROOT_Math_IParamFunction
42 template<
typename FuncPtr = FreeParamMultiFunctionPtr >
76 template<
class Iterator>
141 template<
typename FuncPtr = FreeMultiFunctionPtr >
155 fParIndices(std::vector<unsigned int>(idx, idx + npar) ),
169 fParIndices(std::vector<unsigned int>(idx, idx + npar) ),
192 unsigned int npar =
NPar();
193 std::copy(p, p+ npar,
fParams.begin() );
222 for (
unsigned int i = 0; i <
fDim; ++i) {
232 return (*
fFunc)( &
fX.front() );
239 double DoEvalPar(
const double *
x,
const double * p )
const {
248 unsigned int npar =
NPar();
249 for (
unsigned int i = 0; i < npar +
fDim; ++i) {
251 for (
unsigned int j = 0; j < npar; ++j) {
270 for (
unsigned int i = 0; i < npar; ++i) {
272 assert ( j < npar + fDim);
281 for (
unsigned int i = 0; i < npar; ++i) {
294 mutable std::vector<double>
fX;
unsigned int NDim() const
Retrieve the dimension of the function.
WrappedParamFunction(FuncPtr func, unsigned int dim, Iterator begin, Iterator end)
Constructor a wrapped function from a non-const pointer to a callable object, the function dimension ...
double DoEval(const double *x) const
evaluate the function (re-implement for being more efficient)
double DoEvalPar(const double *x, const double *p) const
implement the required IParamFunction interface
unsigned int NDim() const
Retrieve the dimension of the function.
void SetParValues(unsigned int npar, const double *p) const
std::vector< double > fParams
unsigned int NPar() const
Return the number of Parameters.
WrappedParamFunction(FuncPtr func, unsigned int dim=1, unsigned int npar=0, double *par=0)
Constructor a wrapped function from a pointer to a callable object, the function dimension and number...
WrappedParamGenFunction class to wrap any multi-dimensional function implementing the operator()(cons...
std::vector< unsigned int > fVarIndices
IMultiGenFunction * Clone() const
clone the function
WrappedParamFunctionGen(FuncPtr &func, unsigned int dim, unsigned int npar, const double *par, const unsigned int *idx)
Constructor as before but taking now a non - const pointer to a callable object.
std::vector< double > fParams
double(* FreeParamMultiFunctionPtr)(const double *, const double *)
const double * Parameters() const
Access the parameter values.
void SetParameters(const double *p)
Set the parameter values.
WrappedParamFunctionGen & operator=(const WrappedParamFunctionGen &)
IParamFunction interface (abstract class) describing multi-dimensional parameteric functions It is a ...
WrappedParamFunctionGen(const FuncPtr &func, unsigned int dim, unsigned int npar, const double *par, const unsigned int *idx)
Constructor a wrapped function from a pointer to a generic callable object implemention operator()(co...
IMultiGenFunction * Clone() const
Constructor a wrapped function from a non - const pointer to a callable object, the function dimensio...
double func(double *x, double *p)
std::vector< unsigned int > fParIndices
const double * Parameters() const
Access the parameter values.
double DoEvalPar(const double *x, const double *p) const
evaluate the function given values and parameters (requested interface)
void SetParameters(const double *p)
Set the parameter values.
double(* FreeMultiFunctionPtr)(const double *)
unsigned int NPar() const
Return the number of Parameters.
Documentation for the abstract class IBaseFunctionMultiDim.
WrappedParamFunction class to wrap any multi-dimensional function pbject implementing the operator()(...