ROOT 6.08/07 Reference Guide |
MultiDimParamGradFunctionAdapter class to wrap a one-dimensional parametric gradient function in a multi dimensional parameteric gradient function interface This is used typically in fitting where internally the function is stored as multidimension.
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 deleteing 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 165 of file MultiDimParamFunctionAdapter.h.
Public Types | |
typedef IParamMultiGradFunction::BaseFunc | BaseFunc |
Public Types inherited from ROOT::Math::IParametricGradFunctionMultiDim | |
typedef IParametricFunctionMultiDim::BaseFunc | BaseFunc |
typedef IGradientFunctionMultiDim | BaseGradFunc |
typedef IParametricFunctionMultiDim | BaseParamFunc |
Public Types inherited from ROOT::Math::IParametricFunctionMultiDim | |
typedef IBaseFunctionMultiDim | BaseFunc |
Public Types inherited from ROOT::Math::IBaseFunctionMultiDim | |
typedef IBaseFunctionMultiDim | 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. More... | |
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. More... | |
MultiDimParamGradFunctionAdapter (const MultiDimParamGradFunctionAdapter &rhs) | |
Copy constructor. More... | |
virtual | ~MultiDimParamGradFunctionAdapter () |
Destructor (no operations) More... | |
virtual BaseFunc * | Clone () const |
clone More... | |
unsigned int | NDim () const |
Retrieve the dimension of the function. More... | |
unsigned int | NPar () const |
Return the number of Parameters. More... | |
MultiDimParamGradFunctionAdapter & | operator= (const MultiDimParamGradFunctionAdapter &rhs) |
Assignment operator. More... | |
void | ParameterGradient (const double *x, const double *p, double *grad) const |
Evaluate the all the derivatives (gradient vector) of the function with respect to the parameters at a point x. More... | |
const double * | Parameters () const |
Access the parameter values. More... | |
void | SetParameters (const double *p) |
Set the parameter values. More... | |
Public Member Functions inherited from ROOT::Math::IParametricGradFunctionMultiDim | |
virtual | ~IParametricGradFunctionMultiDim () |
Virtual Destructor (no operations) More... | |
double | ParameterDerivative (const double *x, const double *p, unsigned int ipar=0) const |
Evaluate the partial derivative w.r.t a parameter ipar from values and parameters. More... | |
double | ParameterDerivative (const double *x, unsigned int ipar=0) const |
Evaluate partial derivative using cached parameter values. More... | |
void | ParameterGradient (const double *x, double *grad) const |
Evaluate all derivatives using cached parameter values. More... | |
Public Member Functions inherited from ROOT::Math::IParametricFunctionMultiDim | |
double | operator() (const double *x, const double *p) const |
Evaluate function at a point x and for given parameters p. More... | |
Public Member Functions inherited from ROOT::Math::IBaseFunctionMultiDim | |
IBaseFunctionMultiDim () | |
virtual | ~IBaseFunctionMultiDim () |
virtual destructor More... | |
double | operator() (const double *x) const |
Evaluate the function at a point x[]. More... | |
Public Member Functions inherited from ROOT::Math::IBaseParam | |
virtual | ~IBaseParam () |
Virtual Destructor (no operations) More... | |
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, ...") More... | |
Private Member Functions | |
double | DoEvalPar (const double *x, const double *p) const |
functions needed by interface More... | |
double | DoParameterDerivative (const double *x, const double *p, unsigned int ipar) const |
Evaluate the partial derivative w.r.t a parameter ipar , to be implemented by the derived classes. More... | |
Private Attributes | |
IParamGradFunction * | fFunc |
bool | fOwn |
#include <Math/MultiDimParamFunctionAdapter.h>
Definition at line 169 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 176 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 186 of file MultiDimParamFunctionAdapter.h.
|
inline |
Copy constructor.
Different behaviour according if function is owned or not
Definition at line 195 of file MultiDimParamFunctionAdapter.h.
|
inlinevirtual |
Destructor (no operations)
Definition at line 208 of file MultiDimParamFunctionAdapter.h.
|
inlinevirtual |
clone
Implements ROOT::Math::IBaseFunctionMultiDim.
Definition at line 229 of file MultiDimParamFunctionAdapter.h.
|
inlineprivatevirtual |
functions needed by interface
Implements ROOT::Math::IParametricFunctionMultiDim.
Definition at line 257 of file MultiDimParamFunctionAdapter.h.
|
inlineprivatevirtual |
Evaluate the partial derivative w.r.t a parameter ipar , to be implemented by the derived classes.
Implements ROOT::Math::IParametricGradFunctionMultiDim.
Definition at line 265 of file MultiDimParamFunctionAdapter.h.
|
inlinevirtual |
Retrieve the dimension of the function.
Implements ROOT::Math::IBaseFunctionMultiDim.
Definition at line 242 of file MultiDimParamFunctionAdapter.h.
|
inlinevirtual |
Return the number of Parameters.
Implements ROOT::Math::IBaseParam.
Definition at line 240 of file MultiDimParamFunctionAdapter.h.
|
inline |
Assignment operator.
Definition at line 214 of file MultiDimParamFunctionAdapter.h.
|
inlinevirtual |
Evaluate the all the derivatives (gradient vector) of the function with respect to the parameters at a point x.
It is optional to be implemented by the derived classes for better efficiency
Reimplemented from ROOT::Math::IParametricGradFunctionMultiDim.
Definition at line 248 of file MultiDimParamFunctionAdapter.h.
|
inlinevirtual |
Access the parameter values.
Implements ROOT::Math::IBaseParam.
Definition at line 236 of file MultiDimParamFunctionAdapter.h.
|
inlinevirtual |
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 238 of file MultiDimParamFunctionAdapter.h.
|
private |
Definition at line 272 of file MultiDimParamFunctionAdapter.h.
|
private |
Definition at line 271 of file MultiDimParamFunctionAdapter.h.