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

Description

Specialized Gradient interface(abstract class) for one dimensional functions It provides a method to evaluate the derivative of the function, Derivative and a method to evaluate at the same time the function and the derivative FdF

Concrete classes should derive from ROOT::Math::IGradientFunctionOneDim and not from this class.

Definition at line 247 of file IFunction.h.

Inheritance diagram for ROOT::Math::IGradientOneDim:
[legend]

Public Member Functions

virtual ~IGradientOneDim ()
 virtual destructor More...
 
double Derivative (const double *x) const
 
double Derivative (double x) const
 
void FdF (const double *x, double &f, double *df) const
 
virtual void FdF (double x, double &f, double &df) const =0
 
void Gradient (const double *x, double *g) const
 

Private Member Functions

virtual double DoDerivative (double x) const =0
 

Constructor & Destructor Documentation

◆ ~IGradientOneDim()

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

virtual destructor

Definition at line 252 of file IFunction.h.

252 {}

Member Function Documentation

◆ Derivative() [1/2]

double ROOT::Math::IGradientOneDim::Derivative ( const double *  x) const
inline

Compatibility method with multi-dimensional interface for partial derivative

Definition at line 277 of file IFunction.h.

278  {
279  return DoDerivative(*x);
280  }
virtual double DoDerivative(double x) const =0

References DoDerivative().

Here is the call graph for this function:

◆ Derivative() [2/2]

double ROOT::Math::IGradientOneDim::Derivative ( double  x) const
inline

Return the derivative of the function at a point x Use the private method DoDerivative

Definition at line 258 of file IFunction.h.

259  {
260  return DoDerivative(x);
261  }

References DoDerivative().

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

Here is the call graph for this function:

◆ DoDerivative()

virtual double ROOT::Math::IGradientOneDim::DoDerivative ( double  x) const
privatepure virtual

function to evaluate the derivative with respect each coordinate. To be implemented by the derived class

Implemented in ROOT::Math::GradFunctor1D.

Referenced by Derivative(), and Gradient().

◆ FdF() [1/2]

void ROOT::Math::IGradientOneDim::FdF ( const double *  x,
double &  f,
double *  df 
) const
inline

Compatibility method with multi-dimensional interface for Gradient and function evaluation

Definition at line 293 of file IFunction.h.

294  {
295  FdF(*x, f, *df);
296  }
virtual void FdF(double x, double &f, double &df) const =0

References FdF().

Here is the call graph for this function:

◆ FdF() [2/2]

virtual void ROOT::Math::IGradientOneDim::FdF ( double  x,
double &  f,
double &  df 
) const
pure virtual

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

Implemented in ROOT::Math::IGradientFunctionOneDim.

Referenced by FdF().

◆ Gradient()

void ROOT::Math::IGradientOneDim::Gradient ( const double *  x,
double *  g 
) const
inline

Compatibility method with multi-dimensional interface for Gradient

Definition at line 285 of file IFunction.h.

286  {
287  g[0] = DoDerivative(*x);
288  }

References DoDerivative().

Here is the call graph for this function:

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