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

Description

Specialized IParamFunction interface (abstract class) for one-dimensional parametric functions It is a derived class from ROOT::Math::IBaseFunctionOneDim and ROOT::Math::IBaseParam

Definition at line 156 of file IParamFunction.h.

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

Public Types

typedef IBaseFunctionOneDim BaseFunc
 

Public Member Functions

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
 
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
 

Member Typedef Documentation

◆ BaseFunc

Member Function Documentation

◆ Clone()

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

◆ DoEval()

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

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 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 virtual

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

Referenced by DoEval(), and operator()().

◆ 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
inline

multidim-like interface

Definition at line 184 of file IParamFunction.h.

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

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

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

References DoEvalPar().

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  }
virtual unsigned int NPar() const =0
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: