ccgsl 2.7.2
C++wrappersforGnuScientificLibrary
gsl::deriv Namespace Reference

First-order numerical differentiation. More...

Functions

int central (function_scl const &f, double x, double h, double &result, double &abserr)
 C++ version of gsl_deriv_central(). More...
 
int backward (function_scl const &f, double x, double h, double &result, double &abserr)
 C++ version of gsl_deriv_backward(). More...
 
int forward (function_scl const &f, double x, double h, double &result, double &abserr)
 C++ version of gsl_deriv_forward(). More...
 

Detailed Description

First-order numerical differentiation.

The gsl_function* pointers can be replaced with gsl::function_scl pointers because gsl::function_scl is a derived class of gsl_function.

Function Documentation

◆ backward()

int gsl::deriv::backward ( function_scl const &  f,
double  x,
double  h,
double &  result,
double &  abserr 
)
inline

C++ version of gsl_deriv_backward().

Parameters
fA function of one variable
xValue at which function is to be differentiated
hA small value: std::sqrt( std::numeric_limits<double>::epsilon() ) is a reasonable choice in most cases
resultAn estimate of the derivative at x
abserrEstimate of the error in the estimated derivative
Returns
Error code on failure

Definition at line 73 of file deriv.hpp.

◆ central()

int gsl::deriv::central ( function_scl const &  f,
double  x,
double  h,
double &  result,
double &  abserr 
)
inline

C++ version of gsl_deriv_central().

Parameters
fA function of one variable
xValue at which function is to be differentiated
hA small value: std::sqrt( std::numeric_limits<double>::epsilon() ) is a reasonable choice in most cases
resultAn estimate of the derivative at x
abserrEstimate of the error in the estimated derivative
Returns
Error code on failure

Definition at line 43 of file deriv.hpp.

◆ forward()

int gsl::deriv::forward ( function_scl const &  f,
double  x,
double  h,
double &  result,
double &  abserr 
)
inline

C++ version of gsl_deriv_forward().

Parameters
fA function of one variable
xValue at which function is to be differentiated
hA small value: std::sqrt( std::numeric_limits<double>::epsilon() ) is a reasonable choice in most cases
resultAn estimate of the derivative at x
abserrEstimate of the error in the estimated derivative
Returns
Error code on failure

Definition at line 103 of file deriv.hpp.