IParamFunction interface (abstract class) describing multi-dimensional parametric functions It is a derived class from ROOT::Math::IBaseFunctionMultiDim and ROOT::Math::IBaseParam.
Provides the interface for evaluating a function passing a coordinate vector and a parameter vector.
Definition at line 107 of file IParamFunction.h.
Public Types | |
| typedef T | BackendType |
| typedef IBaseFunctionMultiDimTempl< T > | BaseFunc |
Public Member Functions | |
| virtual IBaseFunctionMultiDimTempl< T > * | Clone () const =0 |
| Clone a function. | |
| T | Derivative (const T *x, unsigned int icoord, T *previous_grad, T *previous_g2, T *previous_gstep) const |
| In some cases, the derivative algorithm will use information from the previous step, these can be passed in with this overload. | |
| T | Derivative (const T *x, unsigned int icoord=0) const |
| Return the partial derivative with respect to the passed coordinate. | |
| virtual void | FdF (const T *x, T &f, T *df) const |
| Optimized method to evaluate at the same time the function value and derivative at a point x. | |
| virtual void | Gradient (const T *x, T *grad) const |
| Evaluate all the vector of function derivatives (gradient) at a point x. | |
| virtual bool | HasGradient () const |
| virtual unsigned int | NDim () const =0 |
| Retrieve the dimension of the function. | |
| virtual unsigned int | NPar () const =0 |
| Return the number of Parameters. | |
| 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. | |
| 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, ..."). | |
| virtual const double * | Parameters () const =0 |
| Access the parameter values. | |
| virtual void | SetParameters (const double *p)=0 |
| Set the parameter values. | |
Private Member Functions | |
| virtual T | DoDerivative (const T *, unsigned int) const |
| Function to evaluate the derivative with respect each coordinate. To be implemented by the derived class. | |
| virtual T | DoDerivativeWithPrevResult (const T *x, unsigned int icoord, T *, T *, T *) const |
| In some cases, the derivative algorithm will use information from the previous step, these can be passed in with this overload. | |
| T | DoEval (const T *x) const override |
| Implement the ROOT::Math::IBaseFunctionMultiDim interface DoEval(x) using the cached parameter values. | |
| virtual T | DoEvalPar (const T *x, const double *p) const =0 |
| Implementation of the evaluation function using the x values and the parameters. | |
#include <Math/IParamFunction.h>
|
inherited |
Definition at line 67 of file IFunction.h.
| typedef IBaseFunctionMultiDimTempl<T> ROOT::Math::IParametricFunctionMultiDimTempl< T >::BaseFunc |
Definition at line 111 of file IParamFunction.h.
|
pure virtualinherited |
Clone a function.
Each derived class must implement their version of the Clone method.
Implemented in ROOT::Fit::FcnAdapter, ROOT::Math::Functor, ROOT::Math::GradFunctor, ROOT::Math::LSResidualFunc< Func >, ROOT::Math::MinimTransformFunction, ROOT::Math::MultiDimParamFunctionAdapter, ROOT::Math::MultiDimParamGradFunctionAdapter, ROOT::Math::MultiNumGradFunction, ROOT::Math::WrappedMemMultiFunction< FuncObj, MemFuncPtr >, ROOT::Math::WrappedMultiFunction< Func >, ROOT::Math::WrappedMultiTF1Templ< T >, ROOT::Math::WrappedMultiTF1Templ< double >, ROOT::Math::WrappedParamFunction< FuncPtr >, and ROOT::Math::WrappedParamFunctionGen< FuncPtr >.
|
inlineinherited |
In some cases, the derivative algorithm will use information from the previous step, these can be passed in with this overload.
The previous_* arrays can also be used to return second derivative and step size so that these can be passed forward again as well at the call site, if necessary.
Definition at line 120 of file IFunction.h.
|
inlineinherited |
Return the partial derivative with respect to the passed coordinate.
Definition at line 115 of file IFunction.h.
|
inlineprivatevirtualinherited |
Function to evaluate the derivative with respect each coordinate. To be implemented by the derived class.
Reimplemented in ROOT::Math::GradFunctor, ROOT::Math::LSResidualFunc< Func >, ROOT::Math::MinimTransformFunction, and ROOT::Math::MultiNumGradFunction.
Definition at line 131 of file IFunction.h.
|
inlineprivatevirtualinherited |
In some cases, the derivative algorithm will use information from the previous step, these can be passed in with this overload.
The previous_* arrays can also be used to return second derivative and step size so that these can be passed forward again as well at the call site, if necessary.
Definition at line 136 of file IFunction.h.
|
inlineoverrideprivatevirtual |
Implement the ROOT::Math::IBaseFunctionMultiDim interface DoEval(x) using the cached parameter values.
Implements ROOT::Math::IBaseFunctionMultiDimTempl< T >.
Reimplemented in ROOT::Math::IParametricGradFunctionMultiDimTempl< T >, ROOT::Math::IParametricGradFunctionMultiDimTempl< double >, ROOT::Math::WrappedMultiTF1Templ< T >, ROOT::Math::WrappedMultiTF1Templ< double >, and ROOT::Math::WrappedParamFunctionGen< FuncPtr >.
Definition at line 143 of file IParamFunction.h.
|
privatepure virtual |
Implementation of the evaluation function using the x values and the parameters.
Must be implemented by derived classes
Implemented in ROOT::Math::IParametricGradFunctionMultiDimTempl< T >, ROOT::Math::IParametricGradFunctionMultiDimTempl< double >, ROOT::Math::MultiDimParamFunctionAdapter, ROOT::Math::MultiDimParamGradFunctionAdapter, ROOT::Math::WrappedMultiTF1Templ< T >, ROOT::Math::WrappedMultiTF1Templ< double >, ROOT::Math::WrappedParamFunction< FuncPtr >, and ROOT::Math::WrappedParamFunctionGen< FuncPtr >.
|
inlinevirtualinherited |
Optimized method to evaluate at the same time the function value and derivative at a point x.
Often both value and derivatives are needed and it is often more efficient to compute them at the same time. Derived class should implement this method if performances play an important role and if it is faster to evaluate value and derivative at the same time
Reimplemented in ROOT::Math::LSResidualFunc< Func >.
Definition at line 108 of file IFunction.h.
|
inlinevirtualinherited |
Evaluate all the vector of function derivatives (gradient) at a point x.
Derived classes must re-implement it if more efficient than evaluating one at a time
Reimplemented in ROOT::Math::GradFunctor, and ROOT::Math::LSResidualFunc< Func >.
Definition at line 96 of file IFunction.h.
|
inlinevirtualinherited |
Reimplemented in ROOT::Math::IGradientFunctionMultiDimTempl< T >, and ROOT::Math::IGradientFunctionMultiDimTempl< double >.
Definition at line 92 of file IFunction.h.
|
pure virtualinherited |
Retrieve the dimension of the function.
Implemented in ROOT::Fit::FcnAdapter, ROOT::Math::BasicFitMethodFunction< ROOT::Math::IMultiGenFunction >, ROOT::Math::BasicFitMethodFunction< ROOT::Math::IMultiGradFunction >, ROOT::Math::Functor, ROOT::Math::GradFunctor, ROOT::Math::LSResidualFunc< Func >, ROOT::Math::MinimTransformFunction, ROOT::Math::MultiDimParamFunctionAdapter, ROOT::Math::MultiDimParamGradFunctionAdapter, ROOT::Math::MultiNumGradFunction, ROOT::Math::WrappedMemMultiFunction< FuncObj, MemFuncPtr >, ROOT::Math::WrappedMultiFunction< Func >, ROOT::Math::WrappedMultiTF1Templ< T >, ROOT::Math::WrappedMultiTF1Templ< double >, ROOT::Math::WrappedParamFunction< FuncPtr >, and ROOT::Math::WrappedParamFunctionGen< FuncPtr >.
|
pure virtualinherited |
Return the number of Parameters.
Implemented in ROOT::Math::MultiDimParamFunctionAdapter, ROOT::Math::MultiDimParamGradFunctionAdapter, ROOT::Math::ParamFunction< IParamGradFunction >, ROOT::Math::VavilovAccurateCdf, ROOT::Math::VavilovAccuratePdf, ROOT::Math::VavilovAccurateQuantile, ROOT::Math::WrappedMultiTF1Templ< T >, ROOT::Math::WrappedMultiTF1Templ< double >, ROOT::Math::WrappedParamFunction< FuncPtr >, ROOT::Math::WrappedParamFunctionGen< FuncPtr >, and ROOT::Math::WrappedTF1.
|
inline |
Definition at line 128 of file IParamFunction.h.
|
inline |
Evaluate function at a point x and for given parameters p.
This method does not change the internal status of the function (internal parameter values). If for some reason one prefers caching the parameter values, SetParameters(p) and then operator()(x) should be called. Use the pure virtual function DoEvalPar to implement it
Definition at line 123 of file IParamFunction.h.
|
inlinevirtualinherited |
Return the name of the i-th parameter (starting from zero) Overwrite if want to avoid the default name ("Par_0, Par_1, ...").
Reimplemented in ROOT::Math::VavilovAccurateCdf, ROOT::Math::VavilovAccuratePdf, ROOT::Math::VavilovAccurateQuantile, ROOT::Math::WrappedMultiTF1Templ< T >, ROOT::Math::WrappedMultiTF1Templ< double >, and ROOT::Math::WrappedTF1.
Definition at line 86 of file IParamFunction.h.
|
pure virtualinherited |
Access the parameter values.
Implemented in ROOT::Math::MultiDimParamFunctionAdapter, ROOT::Math::MultiDimParamGradFunctionAdapter, ROOT::Math::ParamFunction< IParamGradFunction >, ROOT::Math::VavilovAccurateCdf, ROOT::Math::VavilovAccuratePdf, ROOT::Math::VavilovAccurateQuantile, ROOT::Math::WrappedMultiTF1Templ< T >, ROOT::Math::WrappedMultiTF1Templ< double >, ROOT::Math::WrappedParamFunction< FuncPtr >, ROOT::Math::WrappedParamFunctionGen< FuncPtr >, and ROOT::Math::WrappedTF1.
|
pure virtualinherited |
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.
Implemented in ROOT::Math::MultiDimParamFunctionAdapter, ROOT::Math::MultiDimParamGradFunctionAdapter, ROOT::Math::ParamFunction< IParamGradFunction >, ROOT::Math::VavilovAccurateCdf, ROOT::Math::VavilovAccuratePdf, ROOT::Math::VavilovAccurateQuantile, ROOT::Math::WrappedMultiTF1Templ< T >, ROOT::Math::WrappedMultiTF1Templ< double >, ROOT::Math::WrappedParamFunction< FuncPtr >, ROOT::Math::WrappedParamFunctionGen< FuncPtr >, and ROOT::Math::WrappedTF1.