00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef O2SCL_GSL_INTE_QAGIL_H
00024 #define O2SCL_GSL_INTE_QAGIL_H
00025
00026 #include <o2scl/inte.h>
00027 #include <o2scl/gsl_inte_qags.h>
00028
00029 #ifndef DOXYGENP
00030 namespace o2scl {
00031 #endif
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044 template<class param_t, class func_t> class gsl_inte_qagiu :
00045 public gsl_inte_transform<param_t,func_t> {
00046
00047 #ifndef DOXGYEN_INTERNAL
00048
00049 protected:
00050
00051
00052 double la;
00053
00054 #endif
00055
00056 public:
00057
00058
00059
00060
00061
00062
00063
00064 virtual double integ(func_t &func, double a, double b, param_t &pa) {
00065 double res, err;
00066 integ_err(func,a,b,pa,res,err);
00067 this->interror=err;
00068 return res;
00069 }
00070
00071
00072
00073
00074
00075
00076
00077 virtual int integ_err(func_t &func, double a, double b,
00078 param_t &pa, double &res, double &err2) {
00079
00080 la=a;
00081
00082 double fv1[8], fv2[8];
00083
00084 int status=qags(func,8,o2scl_inte_qag_coeffs::qk15_xgk,
00085 o2scl_inte_qag_coeffs::qk15_wg,
00086 o2scl_inte_qag_coeffs::qk15_wgk,
00087 fv1,fv2,0.0,1.0,this->tolx,this->tolf,
00088 this->wkspace,&res,&err2,pa);
00089
00090 return status;
00091
00092 }
00093
00094 #ifndef DOXYGEN_INTERNAL
00095
00096 protected:
00097
00098
00099 virtual double transform(func_t &func, double t, param_t &pa) {
00100 double x=la+(1-t)/t, y=0.0;
00101 func(x,y,pa);
00102
00103 return y/t/t;
00104 }
00105
00106 #endif
00107
00108 };
00109
00110 #ifndef DOXYGENP
00111 }
00112 #endif
00113
00114 #endif