Go to the documentation of this file.
26 #ifndef O2SCL_CERN_CAUCHY_H
27 #define O2SCL_CERN_CAUCHY_H
29 #include <o2scl/inte.h>
30 #include <o2scl/inte_gauss_cern.h>
32 #ifndef DOXYGEN_NO_O2NS
69 template<
class func_t,
class fp_t=double,
70 class weights_t=inte_gauss_coeffs_double>
98 fp_t &res, fp_t &err) {
106 "inte_cauchy_cern::integ_err().",
108 }
else if ((s<a &&
s<b) || (
s>a &&
s>b)) {
109 return it->integ_err(func,a,b,res,err);
113 h=
it->integ(func,2.0*
s-a,b);
116 h=
it->integ(func,a,2.0*
s-b);
135 for(
int i=0;i<4;i++) {
141 s8+=w[i]*((y1+y2)+(y3+y4));
144 for(
int i=4;i<12;i++) {
150 s16+=w[i]*((y1+y2)+(y3+y4));
154 if (std::abs(s16-s8)<=this->
tol_rel*(1.0+std::abs(s16))) {
158 if ((1.0+std::abs(c*c2))==1.0) {
168 if (bb==b0) loop1=
false;
180 #ifndef DOXYGEN_INTERNAL
189 #ifndef DOXYGEN_NO_O2NS
Cauchy principal value integration (CERNLIB)
#define O2SCL_CONV2_RET(d, d2, n, b)
Set an error and return the error value, two-string version.
@ exc_efailed
generic failure
The main O<span style='position: relative; top: 0.3em; font-size: 0.8em'>2</span>scl O$_2$scl names...
@ exc_einval
invalid argument supplied by user
fp_t s
The singularity (must be set before calling integ() or integ_err())
size_t last_iter
The most recent number of iterations taken.
double tol_rel
The maximum relative uncertainty in the value of the integral (default )
Base integration class [abstract base].
inte< func_t, fp_t > * it
The base integration object.
Gaussian quadrature (CERNLIB)
inte_gauss_cern< func_t, fp_t > def_inte
Default integration object.
bool err_nonconv
If true, call the error handler if the routine does not converge or reach the desired tolerance (defa...
int set_inte(inte< func_t, fp_t > &i)
Set the base integration object to use (default is inte_cauchy_cern::def_inte of type inte_gauss_cern...
virtual int integ_err(func_t &func, fp_t a, fp_t b, fp_t &res, fp_t &err)
Integrate function func from a to b.
Documentation generated with Doxygen. Provided under the
GNU Free Documentation License (see License Information).