32 #include <o2scl/funct.h> 34 #ifndef DOXYGEN_NO_O2NS 65 #ifndef DOXYGEN_INTERNAL 104 virtual double deriv(
double x, func_t &func) {
116 virtual double deriv2(
double x, func_t &func) {
121 this,std::placeholders::_1,&func);
131 virtual double deriv3(
double x, func_t &func) {
136 this,std::placeholders::_1,&func);
157 virtual int deriv_err(
double x, func_t &func,
double &dfdx,
164 double &d2fdx2,
double &err) {
167 this,std::placeholders::_1,&func);
179 double &d3fdx3,
double &err) {
182 this,std::placeholders::_1,&func);
190 #ifdef O2SCL_NEVER_DEFINED 195 virtual const char *
type() {
return "deriv"; }
199 #ifndef DOXYGEN_INTERNAL 221 double &dfdx,
double &err)=0;
235 this,std::placeholders::_1,fp);
244 #ifndef DOXYGEN_NO_O2NS double derr
The uncertainity in the most recent derivative computation.
The main O<span style='position: relative; top: 0.3em; font-size: 0.8em'>2</span>scl O$_2$scl names...
virtual int deriv_err(double x, func_t &func, double &dfdx, double &err)=0
Calculate the first derivative of func w.r.t. x and the uncertainty.
std::function< double(double)> funct11
One-dimensional function typedef.
virtual const char * type()
Return string denoting type ("deriv")
bool from_deriv
Avoids infinite loops in case the user calls the base class version.
virtual double deriv(double x, func_t &func)
Calculate the first derivative of func w.r.t. x.
virtual int deriv_err_int(double x, funct11 &func, double &dfdx, double &err)=0
Calculate the first derivative of func w.r.t. x and the uncertainty.
virtual double deriv3(double x, func_t &func)
Calculate the third derivative of func w.r.t. x.
virtual int deriv3_err(double x, func_t &func, double &d3fdx3, double &err)
Calculate the third derivative of func w.r.t. x and the uncertainty.
func_t * func
The pointer to the function.
virtual double deriv2(double x, func_t &func)
Calculate the second derivative of func w.r.t. x.
Numerical differentiation base [abstract base].
virtual double deriv_int(double x, funct11 &func)
Calculate the first derivative of func w.r.t. x.
bool err_nonconv
If true, call the error handler if the routine does not "converge".
virtual int deriv2_err(double x, func_t &func, double &d2fdx2, double &err)
Calculate the second derivative of func w.r.t. x and the uncertainty.
double derivfun(double x, func_t *fp)
The function for the second derivative.
int verbose
Output control.
A structure for passing the function to second and third derivatives [protected]. ...
virtual double get_err()
Get uncertainty of last calculation.
double derivfun2(double x, func_t *fp)
The function for the third derivative.