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::IParametricGradFunctionOneDim Class Referenceabstract

Description

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

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

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 308 of file IParamFunction.h.

Inheritance diagram for ROOT::Math::IParametricGradFunctionOneDim:
[legend]
Collaboration diagram for ROOT::Math::IParametricGradFunctionOneDim:
[legend]

Public Types

typedef IParametricFunctionOneDim::BaseFunc BaseFunc
 
typedef IGradientFunctionOneDim BaseGradFunc
 
typedef IParametricFunctionOneDim BaseParamFunc
 

Public Member Functions

virtual ~IParametricGradFunctionOneDim ()
 
virtual IBaseFunctionOneDimClone () const =0
 
virtual unsigned int NPar () const =0
 
double operator() (const double *x) const
 
double operator() (const double *x, const double *p) const
 
double operator() (double x) const
 
double operator() (double x, const double *p) const
 
double ParameterDerivative (const double *x, const double *p, unsigned int ipar=0) const
 
double ParameterDerivative (const double *x, unsigned int ipar=0) const
 
double ParameterDerivative (double x, const double *p, unsigned int ipar=0) const
 
double ParameterDerivative (double x, unsigned int ipar=0) const
 
void ParameterGradient (const double *x, const double *p, double *grad) const
 
void ParameterGradient (const double *x, double *grad) const
 
virtual void ParameterGradient (double x, const double *p, double *grad) const
 
void ParameterGradient (double x, double *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 double DoEval (double x) const
 
virtual double DoEvalPar (double x, const double *p) const =0
 
virtual double DoParameterDerivative (double x, const double *p, unsigned int ipar) const =0
 

Member Typedef Documentation

◆ BaseFunc

◆ BaseGradFunc

◆ BaseParamFunc

Constructor & Destructor Documentation

◆ ~IParametricGradFunctionOneDim()

virtual ROOT::Math::IParametricGradFunctionOneDim::~IParametricGradFunctionOneDim ( )
inlinevirtual

Virtual Destructor (no operations)

Definition at line 323 of file IParamFunction.h.

323 {}

Member Function Documentation

◆ Clone()

virtual IBaseFunctionOneDim* ROOT::Math::IBaseFunctionOneDim::Clone ( ) const
pure virtualinherited

◆ DoEval()

virtual double ROOT::Math::IParametricFunctionOneDim::DoEval ( double  x) const
inlineprivatevirtualinherited

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

Implements ROOT::Math::IBaseFunctionOneDim.

Definition at line 200 of file IParamFunction.h.

201  {
202  return DoEvalPar(x, Parameters());
203  }
virtual const double * Parameters() const =0
virtual double DoEvalPar(double x, const double *p) const =0

References ROOT::Math::IParametricFunctionOneDim::DoEvalPar(), and ROOT::Math::IBaseParam::Parameters().

Here is the call graph for this function:

◆ DoEvalPar()

virtual double ROOT::Math::IParametricFunctionOneDim::DoEvalPar ( double  x,
const double *  p 
) const
privatepure virtualinherited

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

Referenced by ROOT::Math::IParametricFunctionOneDim::DoEval(), and ROOT::Math::IParametricFunctionOneDim::operator()().

◆ DoParameterDerivative()

virtual double ROOT::Math::IParametricGradFunctionOneDim::DoParameterDerivative ( double  x,
const double *  p,
unsigned int  ipar 
) const
privatepure virtual

Evaluate the gradient, to be implemented by the derived classes

Referenced by ParameterDerivative(), and ParameterGradient().

◆ NPar()

◆ operator()() [1/4]

double ROOT::Math::IBaseFunctionOneDim::operator() ( const double *  x) const
inlineinherited

Evaluate the function at a point x[]. Compatible method with multi-dimensional functions

Definition at line 167 of file IFunction.h.

168  {
169  return DoEval(*x);
170  }
virtual double DoEval(double x) const =0
implementation of the evaluation function. Must be implemented by derived classes

References ROOT::Math::IBaseFunctionOneDim::DoEval().

Here is the call graph for this function:

◆ operator()() [2/4]

double ROOT::Math::IParametricFunctionOneDim::operator() ( const double *  x,
const double *  p 
) const
inlineinherited

multidim-like interface

Definition at line 184 of file IParamFunction.h.

185  {
186  return DoEvalPar(*x, p);
187  }

References ROOT::Math::IParametricFunctionOneDim::DoEvalPar().

Here is the call graph for this function:

◆ operator()() [3/4]

double ROOT::Math::IBaseFunctionOneDim::operator() ( double  x) const
inlineinherited

Evaluate the function at a point x Use the a pure virtual private method DoEval which must be implemented by sub-classes

Definition at line 158 of file IFunction.h.

159  {
160  return DoEval(x);
161  }

References ROOT::Math::IBaseFunctionOneDim::DoEval().

Referenced by ROOT::Math::IGradientFunctionOneDim::FdF().

Here is the call graph for this function:

◆ operator()() [4/4]

double ROOT::Math::IParametricFunctionOneDim::operator() ( double  x,
const double *  p 
) const
inlineinherited

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 175 of file IParamFunction.h.

176  {
177  return DoEvalPar(x, p);
178  }

References ROOT::Math::IParametricFunctionOneDim::DoEvalPar().

Here is the call graph for this function:

◆ ParameterDerivative() [1/4]

double ROOT::Math::IParametricGradFunctionOneDim::ParameterDerivative ( const double *  x,
const double *  p,
unsigned int  ipar = 0 
) const
inline

Partial derivative with respect a parameter Compatibility interface with multi-dimensional functions

Definition at line 384 of file IParamFunction.h.

385  {
386  return DoParameterDerivative(*x, p, ipar);
387  }
virtual double DoParameterDerivative(double x, const double *p, unsigned int ipar) const =0

References DoParameterDerivative().

Here is the call graph for this function:

◆ ParameterDerivative() [2/4]

double ROOT::Math::IParametricGradFunctionOneDim::ParameterDerivative ( const double *  x,
unsigned int  ipar = 0 
) const
inline

Evaluate partial derivative using cached parameter values (multi-dim like interface)

Definition at line 393 of file IParamFunction.h.

394  {
395  return DoParameterDerivative(*x, Parameters() , ipar);
396  }

References DoParameterDerivative(), and ROOT::Math::IBaseParam::Parameters().

Here is the call graph for this function:

◆ ParameterDerivative() [3/4]

double ROOT::Math::IParametricGradFunctionOneDim::ParameterDerivative ( double  x,
const double *  p,
unsigned int  ipar = 0 
) const
inline

Partial derivative with respect a parameter

Definition at line 367 of file IParamFunction.h.

368  {
369  return DoParameterDerivative(x, p, ipar);
370  }

References DoParameterDerivative().

Here is the call graph for this function:

◆ ParameterDerivative() [4/4]

double ROOT::Math::IParametricGradFunctionOneDim::ParameterDerivative ( double  x,
unsigned int  ipar = 0 
) const
inline

Evaluate partial derivative using cached parameter values

Definition at line 375 of file IParamFunction.h.

376  {
377  return DoParameterDerivative(x, Parameters() , ipar);
378  }

References DoParameterDerivative(), and ROOT::Math::IBaseParam::Parameters().

Here is the call graph for this function:

◆ ParameterGradient() [1/4]

void ROOT::Math::IParametricGradFunctionOneDim::ParameterGradient ( const double *  x,
const double *  p,
double *  grad 
) const
inline

Compatibility interface with multi-dimensional functions

Definition at line 350 of file IParamFunction.h.

351  {
352  ParameterGradient(*x, p, grad);
353  }
virtual void ParameterGradient(double x, const double *p, double *grad) const

References ParameterGradient().

Here is the call graph for this function:

◆ ParameterGradient() [2/4]

void ROOT::Math::IParametricGradFunctionOneDim::ParameterGradient ( const double *  x,
double *  grad 
) const
inline

Evaluate all derivatives using cached parameter values (multi-dim like interface)

Definition at line 358 of file IParamFunction.h.

359  {
360  return ParameterGradient(*x, Parameters(), grad);
361  }

References ParameterGradient(), and ROOT::Math::IBaseParam::Parameters().

Here is the call graph for this function:

◆ ParameterGradient() [3/4]

virtual void ROOT::Math::IParametricGradFunctionOneDim::ParameterGradient ( double  x,
const double *  p,
double *  grad 
) const
inlinevirtual

Evaluate the derivatives 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 if needed

Definition at line 332 of file IParamFunction.h.

333  {
334  unsigned int npar = NPar();
335  for (unsigned int ipar = 0; ipar < npar; ++ipar)
336  grad[ipar] = DoParameterDerivative(x, p, ipar);
337  }
virtual unsigned int NPar() const =0

References DoParameterDerivative(), and ROOT::Math::IBaseParam::NPar().

Referenced by ParameterGradient().

Here is the call graph for this function:

◆ ParameterGradient() [4/4]

void ROOT::Math::IParametricGradFunctionOneDim::ParameterGradient ( double  x,
double *  grad 
) const
inline

Evaluate all derivatives using cached parameter values

Definition at line 342 of file IParamFunction.h.

343  {
344  return ParameterGradient(x, Parameters(), grad);
345  }

References ParameterGradient(), and ROOT::Math::IBaseParam::Parameters().

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: