32 #include <o2scl/funct.h>
34 #ifndef DOXYGEN_NO_O2NS
57 #ifndef DOXYGEN_INTERNAL
96 virtual double deriv(
double x, func_t &func) {
106 virtual double deriv2(
double x, func_t &func) {
111 this,std::placeholders::_1,&func);
121 virtual double deriv3(
double x, func_t &func) {
126 this,std::placeholders::_1,&func);
147 virtual int deriv_err(
double x, func_t &func,
double &dfdx,
154 double &d2fdx2,
double &err) {
159 this,std::placeholders::_1,&func);
171 double &d3fdx3,
double &err) {
176 this,std::placeholders::_1,&func);
184 #ifdef O2SCL_NEVER_DEFINED
189 virtual const char *
type() {
return "deriv"; }
193 #ifndef DOXYGEN_INTERNAL
203 deriv_err_int(x,func,dx,derr);
214 virtual int deriv_err_int(
double x,
funct11 &func,
215 double &dfdx,
double &err)=0;
229 this,std::placeholders::_1,fp);
230 double val=deriv_int(x,mf);
238 #ifndef DOXYGEN_NO_O2NS
double derr
The uncertainity in the most recent derivative computation.
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.