atomicrex  0.1
An advanced atomistic model building tool
Public Member Functions | Protected Member Functions | List of all members
atomicrex::NumericalDerivative Class Referenceabstract

#include <NumericalDerivative.h>

Inheritance diagram for atomicrex::NumericalDerivative:
atomicrex::NumericalGradientEvaluator

Public Member Functions

double compute (double x, double &error, double epsilon=1e-5)
 

Protected Member Functions

virtual double evaluate (double x)=0
 
double centralDerivative (double x, double h, double &abserr_trunc, double &abserr_round)
 

Detailed Description

This utility class allows to verify the analytic derivative of a (one-dimensional) function by means of numerical differentiation.

Member Function Documentation

◆ centralDerivative()

double atomicrex::NumericalDerivative::centralDerivative ( double  x,
double  h,
double &  abserr_trunc,
double &  abserr_round 
)
inlineprotected

Compute the derivative using the 5-point rule (-h, -h/2, 0, +h/2, +h). Note that the central point is not used.

◆ compute()

double atomicrex::NumericalDerivative::compute ( double  x,
double &  error,
double  epsilon = 1e-5 
)
inline

Compute the numerical derivative of the function at position x. The estimated error of the numerical derivative is also returned.

◆ evaluate()

virtual double atomicrex::NumericalDerivative::evaluate ( double  x)
protectedpure virtual

Evaluates the function at position x. Implementation must be provided by sub-classes.

Implemented in atomicrex::NumericalGradientEvaluator.


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