WrappedParamGenFunction class to wrap any multi-dimensional function implementing the operator()(const double * ) in an interface-like IParamFunction, by fixing some of the variables and define them as parameters.
i.e. transform any multi-dim function in a parametric function
Definition at line 143 of file WrappedParamFunction.h.
Public Member Functions | |
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 implementation operator()(const double *), the new function dimension, the number of parameters (number of fixed variables) and an array specifying the index of the fixed variables which became parameters in the new API. | |
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. | |
IMultiGenFunction * | Clone () const override |
clone the function | |
unsigned int | NDim () const override |
Retrieve the dimension of the function. | |
unsigned int | NPar () const override |
Return the number of Parameters. | |
const double * | Parameters () const override |
Access the parameter values. | |
void | SetParameters (const double *p) override |
Set the parameter values. | |
Public Member Functions inherited from ROOT::Math::IParametricFunctionMultiDimTempl< double > | |
double | operator() (const double *x) const |
double | operator() (const double *x, const double *p) const |
Evaluate function at a point x and for given parameters p. | |
Public Member Functions inherited from ROOT::Math::IBaseFunctionMultiDimTempl< T > | |
virtual | ~IBaseFunctionMultiDimTempl ()=default |
virtual bool | HasGradient () const |
T | operator() (const T *x) const |
Evaluate the function at a point x[]. | |
Public Member Functions inherited from ROOT::Math::IBaseParam | |
virtual | ~IBaseParam () |
Virtual Destructor (no operations) | |
virtual std::string | ParameterName (unsigned int i) const |
Return the name of the i-th parameter (starting from zero) Overwrite if want to avoid the default name ("Par_0, Par_1, ...") | |
Private Member Functions | |
WrappedParamFunctionGen (const WrappedParamFunctionGen &) | |
double | DoEval (const double *x) const override |
evaluate the function (re-implement for being more efficient) | |
double | DoEvalPar (const double *x, const double *p) const override |
implement the required IParamFunction interface | |
void | DoInit () |
WrappedParamFunctionGen & | operator= (const WrappedParamFunctionGen &) |
void | SetParValues (unsigned int npar, const double *p) const |
Private Attributes | |
unsigned int | fDim |
FuncPtr | fFunc |
std::vector< double > | fParams |
std::vector< unsigned int > | fParIndices |
std::vector< unsigned int > | fVarIndices |
std::vector< double > | fX |
Additional Inherited Members | |
Public Types inherited from ROOT::Math::IParametricFunctionMultiDimTempl< double > | |
typedef IBaseFunctionMultiDimTempl< double > | BaseFunc |
Public Types inherited from ROOT::Math::IBaseFunctionMultiDimTempl< T > | |
typedef T | BackendType |
typedef IBaseFunctionMultiDimTempl< T > | BaseFunc |
#include <Math/WrappedParamFunction.h>
|
inline |
Constructor a wrapped function from a pointer to a generic callable object implementation operator()(const double *), the new function dimension, the number of parameters (number of fixed variables) and an array specifying the index of the fixed variables which became parameters in the new API.
Definition at line 152 of file WrappedParamFunction.h.
|
inline |
Constructor as before but taking now a non - const pointer to a callable object.
This constructor is needed in the case FuncPtr is a std::unique_ptr which has a copy ctor taking non const objects
Definition at line 166 of file WrappedParamFunction.h.
|
private |
|
inlineoverridevirtual |
clone the function
Implements ROOT::Math::IBaseFunctionMultiDimTempl< T >.
Definition at line 177 of file WrappedParamFunction.h.
|
inlineoverrideprivatevirtual |
evaluate the function (re-implement for being more efficient)
Reimplemented from ROOT::Math::IParametricFunctionMultiDimTempl< double >.
Definition at line 213 of file WrappedParamFunction.h.
|
inlineoverrideprivatevirtual |
implement the required IParamFunction interface
Implements ROOT::Math::IParametricFunctionMultiDimTempl< double >.
Definition at line 240 of file WrappedParamFunction.h.
|
inlineprivate |
Definition at line 246 of file WrappedParamFunction.h.
|
inlineoverridevirtual |
Retrieve the dimension of the function.
Implements ROOT::Math::IBaseFunctionMultiDimTempl< T >.
Definition at line 200 of file WrappedParamFunction.h.
|
inlineoverridevirtual |
Return the number of Parameters.
Implements ROOT::Math::IBaseParam.
Definition at line 198 of file WrappedParamFunction.h.
|
private |
|
inlineoverridevirtual |
Access the parameter values.
Implements ROOT::Math::IBaseParam.
Definition at line 188 of file WrappedParamFunction.h.
|
inlineoverridevirtual |
Set the parameter values.
p | vector of doubles containing the parameter values. |
to be defined: can user change number of params ? At the moment no.
Implements ROOT::Math::IBaseParam.
Definition at line 192 of file WrappedParamFunction.h.
|
inlineprivate |
Definition at line 281 of file WrappedParamFunction.h.
|
private |
Definition at line 291 of file WrappedParamFunction.h.
|
mutableprivate |
Definition at line 290 of file WrappedParamFunction.h.
|
private |
Definition at line 292 of file WrappedParamFunction.h.
|
private |
Definition at line 294 of file WrappedParamFunction.h.
|
private |
Definition at line 293 of file WrappedParamFunction.h.
|
mutableprivate |
Definition at line 295 of file WrappedParamFunction.h.