atomicrex
0.1
An advanced atomistic model building tool
|
#include <NumericalDerivative.h>
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) |
This utility class allows to verify the analytic derivative of a (one-dimensional) function by means of numerical differentiation.
|
inlineprotected |
Compute the derivative using the 5-point rule (-h, -h/2, 0, +h/2, +h). Note that the central point is not used.
|
inline |
Compute the numerical derivative of the function at position x. The estimated error of the numerical derivative is also returned.
|
protectedpure virtual |
Evaluates the function at position x. Implementation must be provided by sub-classes.
Implemented in atomicrex::NumericalGradientEvaluator.