Go to the documentation of this file.
31 #include <o2scl/err_hnd.h>
32 #include <o2scl/funct.h>
34 #ifndef DOXYGEN_NO_O2NS
51 template<
class func_t=funct,
class fp_t=
double>
class inte {
92 virtual fp_t
integ(func_t &func, fp_t a, fp_t b) {
96 O2SCL_ERR2(
"Integration failed in inte::integ(), ",
105 virtual int integ_err(func_t &func, fp_t a, fp_t b,
106 fp_t &res, fp_t &err)=0;
117 virtual const char *
type() {
return "inte"; }
119 #ifndef DOXYGEN_INTERNAL
136 template<
class func_t,
class def_
inte_t,
class fp_t=
double>
163 this,std::placeholders::_1);
189 fp_t &res, fp_t &err) {
192 int ret=
it->integ_err(
fo,0.0,1.0,res,err);
216 template<
class func_t,
class def_
inte_t,
class fp_t=
double>
243 this,std::placeholders::_1);
269 fp_t &res, fp_t &err) {
272 int ret=
it->integ_err(
fo,0.0,1.0,res,err);
291 #ifndef DOXYGEN_NO_O2NS
virtual fp_t transform(fp_t t)
Transform from to .
virtual fp_t transform(fp_t t)
Transform from to .
fp_t interror
The uncertainty for the last integration computation.
std::function< fp_t(fp_t)> internal_funct
Internal function type based on floating-point type.
virtual const char * type()
Return string denoting type ("inte")
@ exc_efailed
generic failure
#define O2SCL_ERR2(d, d2, n)
Set an error, two-string version.
virtual int integ_err(func_t &func, fp_t a, fp_t &res, fp_t &err)
Integrate function func from a to b giving result res and error err.
def_inte_t def_inte
Default integration object.
The main O<span style='position: relative; top: 0.3em; font-size: 0.8em'>2</span>scl O$_2$scl names...
fp_t lower_limit
The lower limit.
internal_funct fo
Function object.
fp_t get_error()
Return the numerically estimated error in the result from the last call to integ()
virtual int integ_err(func_t &func, fp_t b, fp_t &res, fp_t &err)
Integrate function func from a to b giving result res and error err.
size_t last_iter
The most recent number of iterations taken.
func_t * user_func
A pointer to the user-specified function.
fp_t tol_abs
The maximum absolute uncertainty in the value of the integral (default )
std::function< fp_t(fp_t)> internal_funct
Internal function type based on floating-point type.
fp_t tol_rel
The maximum relative uncertainty in the value of the integral (default )
virtual fp_t integ(func_t &func, fp_t a, fp_t b)
Integrate function func from a to b.
Base integration class [abstract base].
inte< internal_funct, fp_t > * it
The base integration object.
int set_inte(inte< internal_funct, fp_t > &i)
Set the base integration object to use.
bool err_nonconv
If true, call the error handler if the routine does not converge or reach the desired tolerance (defa...
inte< internal_funct, fp_t > * it
The base integration object.
fp_t upper_limit
The upper limit.
int set_inte(inte< internal_funct, fp_t > &i)
Set the base integration object to use.
virtual int integ_err(func_t &func, fp_t a, fp_t b, fp_t &res, fp_t &err)=0
Integrate function func from a to b and place the result in res and the error in err.
internal_funct fo
Function object.
def_inte_t def_inte
Default integration object.
func_t * user_func
A pointer to the user-specified function.
Documentation generated with Doxygen. Provided under the
GNU Free Documentation License (see License Information).