BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
ROOT::Math::IParametricGradFunctionMultiDimTempl< T > Class Template Referenceabstract

Description

template<class T>
class ROOT::Math::IParametricGradFunctionMultiDimTempl< T >

Interface (abstract class) for parametric gradient multi-dimensional functions providing in addition to function evaluation with respect to the coordinates also the gradient with respect to the parameters, via the method ParameterGradient.

It is a derived class from ROOT::Math::IParametricFunctionMultiDim.

The pure private virtual method DoParameterGradient must be implemented by the derived classes in addition to those inherited by the base abstract classes.

Definition at line 224 of file IParamFunction.h.

Inheritance diagram for ROOT::Math::IParametricGradFunctionMultiDimTempl< T >:
[legend]
Collaboration diagram for ROOT::Math::IParametricGradFunctionMultiDimTempl< T >:
[legend]

Public Types

typedef T BackendType
 
using BaseFunc = typename IParametricFunctionMultiDimTempl< T >::BaseFunc
 
using BaseGradFunc = IGradientFunctionMultiDimTempl< T >
 
using BaseParamFunc = IParametricFunctionMultiDimTempl< T >
 

Public Member Functions

virtual ~IParametricGradFunctionMultiDimTempl ()
 
virtual IBaseFunctionMultiDimTempl< T > * Clone () const =0
 
virtual unsigned int NDim () const =0
 
virtual unsigned int NPar () const =0
 
operator() (const T *x) const
 
operator() (const T *x, const double *p) const
 
ParameterDerivative (const T *x, const double *p, unsigned int ipar=0) const
 
ParameterDerivative (const T *x, unsigned int ipar=0) const
 
virtual void ParameterGradient (const T *x, const double *p, T *grad) const
 
void ParameterGradient (const T *x, T *grad) const
 
virtual std::string ParameterName (unsigned int i) const
 
virtual const double * Parameters () const =0
 
virtual void SetParameters (const double *p)=0
 

Private Member Functions

virtual T DoEval (const T *x) const
 
virtual T DoEvalPar (const T *x, const double *p) const =0
 
virtual T DoParameterDerivative (const T *x, const double *p, unsigned int ipar) const =0
 

Member Typedef Documentation

◆ BackendType

template<class T >
typedef T ROOT::Math::IBaseFunctionMultiDimTempl< T >::BackendType
inherited

Definition at line 66 of file IFunction.h.

◆ BaseFunc

Definition at line 229 of file IParamFunction.h.

◆ BaseGradFunc

◆ BaseParamFunc

Constructor & Destructor Documentation

◆ ~IParametricGradFunctionMultiDimTempl()

Virtual Destructor (no operations)

Definition at line 235 of file IParamFunction.h.

235 {}

Member Function Documentation

◆ Clone()

◆ DoEval()

template<class T >
virtual T ROOT::Math::IParametricGradFunctionMultiDimTempl< T >::DoEval ( const T *  x) const
inlineprivatevirtual

Implement the ROOT::Math::IBaseFunctionMultiDim interface DoEval(x) using the cached parameter values

Reimplemented from ROOT::Math::IParametricFunctionMultiDimTempl< T >.

Definition at line 288 of file IParamFunction.h.

289  {
290  return DoEvalPar(x, Parameters());
291  }
virtual const double * Parameters() const =0
virtual T DoEvalPar(const T *x, const double *p) const =0

References ROOT::Math::IParametricGradFunctionMultiDimTempl< T >::DoEvalPar(), and ROOT::Math::IBaseParam::Parameters().

Referenced by ROOT::Math::IParametricGradFunctionMultiDimTempl< T >::operator()().

Here is the call graph for this function:

◆ DoEvalPar()

template<class T >
virtual T ROOT::Math::IParametricGradFunctionMultiDimTempl< T >::DoEvalPar ( const T *  x,
const double *  p 
) const
privatepure virtual

Implementation of the evaluation function using the x values and the parameters. Must be implemented by derived classes

Implements ROOT::Math::IParametricFunctionMultiDimTempl< T >.

Referenced by ROOT::Math::IParametricGradFunctionMultiDimTempl< T >::DoEval(), and ROOT::Math::IParametricGradFunctionMultiDimTempl< T >::operator()().

◆ DoParameterDerivative()

template<class T >
virtual T ROOT::Math::IParametricGradFunctionMultiDimTempl< T >::DoParameterDerivative ( const T *  x,
const double *  p,
unsigned int  ipar 
) const
privatepure virtual

Evaluate the partial derivative w.r.t a parameter ipar , to be implemented by the derived classes

Referenced by ROOT::Math::IParametricGradFunctionMultiDimTempl< T >::ParameterDerivative(), and ROOT::Math::IParametricGradFunctionMultiDimTempl< T >::ParameterGradient().

◆ NDim()

◆ NPar()

◆ operator()() [1/2]

template<class T >
T ROOT::Math::IParametricGradFunctionMultiDimTempl< T >::operator() ( const T *  x) const
inline

Definition at line 245 of file IParamFunction.h.

246  {
247  return DoEval(x);
248  }

References ROOT::Math::IParametricGradFunctionMultiDimTempl< T >::DoEval().

Here is the call graph for this function:

◆ operator()() [2/2]

template<class T >
T ROOT::Math::IParametricGradFunctionMultiDimTempl< T >::operator() ( const T *  x,
const double *  p 
) const
inline

Definition at line 240 of file IParamFunction.h.

241  {
242  return DoEvalPar(x, p);
243  }

References ROOT::Math::IParametricGradFunctionMultiDimTempl< T >::DoEvalPar().

Here is the call graph for this function:

◆ ParameterDerivative() [1/2]

template<class T >
T ROOT::Math::IParametricGradFunctionMultiDimTempl< T >::ParameterDerivative ( const T *  x,
const double *  p,
unsigned int  ipar = 0 
) const
inline

Evaluate the partial derivative w.r.t a parameter ipar from values and parameters

Definition at line 264 of file IParamFunction.h.

265  {
266  return DoParameterDerivative(x, p, ipar);
267  }
virtual T DoParameterDerivative(const T *x, const double *p, unsigned int ipar) const =0

References ROOT::Math::IParametricGradFunctionMultiDimTempl< T >::DoParameterDerivative().

Here is the call graph for this function:

◆ ParameterDerivative() [2/2]

template<class T >
T ROOT::Math::IParametricGradFunctionMultiDimTempl< T >::ParameterDerivative ( const T *  x,
unsigned int  ipar = 0 
) const
inline

Evaluate partial derivative using cached parameter values

Definition at line 276 of file IParamFunction.h.

277  {
278  return DoParameterDerivative(x, Parameters() , ipar);
279  }

References ROOT::Math::IParametricGradFunctionMultiDimTempl< T >::DoParameterDerivative(), and ROOT::Math::IBaseParam::Parameters().

Here is the call graph for this function:

◆ ParameterGradient() [1/2]

template<class T >
virtual void ROOT::Math::IParametricGradFunctionMultiDimTempl< T >::ParameterGradient ( const T *  x,
const double *  p,
T *  grad 
) const
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

Definition at line 254 of file IParamFunction.h.

255  {
256  unsigned int npar = NPar();
257  for (unsigned int ipar = 0; ipar < npar; ++ipar)
258  grad[ipar] = DoParameterDerivative(x, p, ipar);
259  }
virtual unsigned int NPar() const =0

References ROOT::Math::IParametricGradFunctionMultiDimTempl< T >::DoParameterDerivative(), and ROOT::Math::IBaseParam::NPar().

Here is the call graph for this function:

◆ ParameterGradient() [2/2]

template<class T >
void ROOT::Math::IParametricGradFunctionMultiDimTempl< T >::ParameterGradient ( const T *  x,
T *  grad 
) const
inline

Evaluate all derivatives using cached parameter values

Definition at line 272 of file IParamFunction.h.

272 { return ParameterGradient(x, Parameters(), grad); }
virtual void ParameterGradient(const T *x, const double *p, T *grad) const

References ROOT::Math::IParametricGradFunctionMultiDimTempl< T >::ParameterGradient(), and ROOT::Math::IBaseParam::Parameters().

Referenced by ROOT::Math::IParametricGradFunctionMultiDimTempl< T >::ParameterGradient().

Here is the call graph for this function:

◆ ParameterName()

virtual std::string ROOT::Math::IBaseParam::ParameterName ( unsigned int  i) const
inlinevirtualinherited

Return the name of the i-th parameter (starting from zero) Overwrite if want to avoid the default name ("Par_0, Par_1, ...")

Definition at line 83 of file IParamFunction.h.

84  {
85  assert(i < NPar());
86  return "Par_" + Util::ToString(i);
87  }
std::string ToString(const T &val)
Definition: Util.h:42

References ROOT::Math::IBaseParam::NPar(), and ROOT::Math::Util::ToString().

Referenced by ROOT::Fit::FitConfig::CreateParamsSettings().

Here is the call graph for this function:

◆ Parameters()

◆ SetParameters()

virtual void ROOT::Math::IBaseParam::SetParameters ( const double *  p)
pure virtualinherited

Set the parameter values

Parameters
pvector of doubles containing the parameter values.

to be defined: can user change number of params ? At the moment no.

Implemented in ROOT::Math::WrappedParamFunctionGen< FuncPtr >, and ROOT::Math::WrappedParamFunction< FuncPtr >.


The documentation for this class was generated from the following file: