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 template<class param_t, class func_t> class gsl_inte_qagil :
00037 public gsl_inte_transform<param_t,func_t> {
00038
00039 #ifndef DOXYGEN_INTERNAL
00040
00041 protected:
00042
00043
00044 double lb;
00045
00046 #endif
00047
00048 public:
00049
00050
00051
00052
00053
00054
00055 virtual double integ(func_t &func, double a, double b, param_t &pa) {
00056 double res, err;
00057 integ_err(func,a,b,pa,res,err);
00058 this->interror=err;
00059 return res;
00060 }
00061
00062
00063
00064
00065
00066
00067
00068 virtual int integ_err(func_t &func, double a, double b,
00069 param_t &pa, double &res, double &err2) {
00070
00071 lb=b;
00072
00073 double fv1[8], fv2[8];
00074
00075 int status=qags(func,8,o2scl_inte_qag_coeffs::qk15_xgk,
00076 o2scl_inte_qag_coeffs::qk15_wg,
00077 o2scl_inte_qag_coeffs::qk15_wgk,
00078 fv1,fv2,0.0,1.0,this->tolx,this->tolf,
00079 this->wkspace,&res,&err2,pa);
00080 return status;
00081
00082 }
00083
00084 protected:
00085
00086
00087 virtual double transform(func_t &func, double t, param_t &pa) {
00088 double x=lb-(1-t)/t, y;
00089 func(x,y,pa);
00090 return y/t/t;
00091 }
00092
00093 };
00094
00095 #ifndef DOXYGENP
00096 }
00097 #endif
00098
00099 #endif