MultiDimParamGradFunctionAdapter class to wrap a one-dimensional parametric gradient function in a multi dimensional parametric gradient function interface This is used typically in fitting where internally the function is stored as multidimensional.
To wrap a non-parametric one-dim gradient function in a multi-dim interface one can use simply a a ROOT::Math::GradFunctor
The parameters are not stored in the adapter class and by default the pointer to the 1D function is owned. This means that deleting the class deletes also the 1D function and copying the class copies also the 1D function This class differs from WrappedParamFunction in the fact that the parameters are not stored in the adapter class and optionally it keeps a cloned and managed copy of the adapter class.
Definition at line 172 of file MultiDimParamFunctionAdapter.h.
Public Types | |
typedef IParamMultiGradFunction::BaseFunc | BaseFunc |
Public Types inherited from ROOT::Math::IParametricGradFunctionMultiDimTempl< T > | |
using | BaseFunc = typename IParametricFunctionMultiDimTempl< T >::BaseFunc |
using | BaseGradFunc = IGradientFunctionMultiDimTempl< T > |
using | BaseParamFunc = IParametricFunctionMultiDimTempl< T > |
Public Types inherited from ROOT::Math::IParametricFunctionMultiDimTempl< T > | |
typedef IBaseFunctionMultiDimTempl< T > | BaseFunc |
Public Types inherited from ROOT::Math::IBaseFunctionMultiDimTempl< T > | |
typedef T | BackendType |
typedef IBaseFunctionMultiDimTempl< T > | BaseFunc |
Public Member Functions | |
MultiDimParamGradFunctionAdapter (const IParamGradFunction &f) | |
Constructor from a param one dim function interface from a const reference Copy and manage the own function pointer. | |
MultiDimParamGradFunctionAdapter (const MultiDimParamGradFunctionAdapter &rhs) | |
Copy constructor. | |
MultiDimParamGradFunctionAdapter (IParamGradFunction &f) | |
Constructor from a param one dim function interface from a non const reference Do not own the function pointer in this case. | |
~MultiDimParamGradFunctionAdapter () override | |
Destructor (no operations) | |
BaseFunc * | Clone () const override |
clone | |
unsigned int | NDim () const override |
Retrieve the dimension of the function. | |
unsigned int | NPar () const override |
Return the number of Parameters. | |
MultiDimParamGradFunctionAdapter & | operator= (const MultiDimParamGradFunctionAdapter &rhs) |
Assignment operator. | |
void | ParameterGradient (const double *x, const double *p, double *grad) const override |
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::IParametricGradFunctionMultiDimTempl< T > | |
~IParametricGradFunctionMultiDimTempl () override | |
Virtual Destructor (no operations) | |
virtual bool | HasParameterHessian () const |
T | operator() (const T *x) const |
T | operator() (const T *x, const double *p) const |
T | ParameterDerivative (const T *x, const double *p, unsigned int ipar=0) const |
Evaluate the partial derivative w.r.t a parameter ipar from values and parameters. | |
T | ParameterDerivative (const T *x, unsigned int ipar=0) const |
Evaluate partial derivative using cached parameter values. | |
virtual bool | ParameterG2 (const T *, const double *, T *) const |
Evaluate all the second derivatives (diagonal ones) of the function with respect to the parameters at a point x. | |
virtual void | ParameterGradient (const T *x, const double *p, T *grad) const |
Evaluate the all the derivatives (gradient vector) of the function with respect to the parameters at a point x. | |
void | ParameterGradient (const T *x, T *grad) const |
Evaluate all derivatives using cached parameter values. | |
virtual bool | ParameterHessian (const T *, const double *, T *) const |
Evaluate the all the Hessian (second derivatives matrix) of the function with respect to the parameters at a point x. | |
Public Member Functions inherited from ROOT::Math::IParametricFunctionMultiDimTempl< T > | |
T | operator() (const T *x) const |
T | operator() (const T *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 | |
double | DoEvalPar (const double *x, const double *p) const override |
functions needed by interface | |
double | DoParameterDerivative (const double *x, const double *p, unsigned int ipar) const override |
Private Attributes | |
IParamGradFunction * | fFunc |
bool | fOwn |
#include <Math/MultiDimParamFunctionAdapter.h>
Definition at line 176 of file MultiDimParamFunctionAdapter.h.
|
inline |
Constructor from a param one dim function interface from a const reference Copy and manage the own function pointer.
Definition at line 183 of file MultiDimParamFunctionAdapter.h.
|
inline |
Constructor from a param one dim function interface from a non const reference Do not own the function pointer in this case.
Definition at line 193 of file MultiDimParamFunctionAdapter.h.
|
inline |
Copy constructor.
Different behaviour according if function is owned or not
Definition at line 202 of file MultiDimParamFunctionAdapter.h.
|
inlineoverride |
Destructor (no operations)
Definition at line 215 of file MultiDimParamFunctionAdapter.h.
|
inlineoverridevirtual |
clone
Implements ROOT::Math::IBaseFunctionMultiDimTempl< T >.
Definition at line 239 of file MultiDimParamFunctionAdapter.h.
|
inlineoverrideprivate |
functions needed by interface
Definition at line 281 of file MultiDimParamFunctionAdapter.h.
|
inlineoverrideprivate |
Definition at line 290 of file MultiDimParamFunctionAdapter.h.
|
inlineoverridevirtual |
Retrieve the dimension of the function.
Implements ROOT::Math::IBaseFunctionMultiDimTempl< T >.
Definition at line 262 of file MultiDimParamFunctionAdapter.h.
|
inlineoverridevirtual |
Return the number of Parameters.
Implements ROOT::Math::IBaseParam.
Definition at line 257 of file MultiDimParamFunctionAdapter.h.
|
inline |
Assignment operator.
Definition at line 224 of file MultiDimParamFunctionAdapter.h.
|
inlineoverride |
Definition at line 271 of file MultiDimParamFunctionAdapter.h.
|
inlineoverridevirtual |
Access the parameter values.
Implements ROOT::Math::IBaseParam.
Definition at line 247 of file MultiDimParamFunctionAdapter.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 252 of file MultiDimParamFunctionAdapter.h.
|
private |
Definition at line 298 of file MultiDimParamFunctionAdapter.h.
|
private |
Definition at line 297 of file MultiDimParamFunctionAdapter.h.