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_QAGS_H
00024 #define O2SCL_GSL_INTE_QAGS_H
00025
00026 #include <o2scl/inte.h>
00027 #include <o2scl/gsl_inte_qag.h>
00028
00029 #ifndef DOXYGENP
00030 namespace o2scl {
00031 #endif
00032
00033
00034
00035 template<class param_t, class func_t> class gsl_inte_qags :
00036 public gsl_inte_singular<param_t,func_t> {
00037
00038 public:
00039
00040
00041
00042 virtual double integ(func_t &func, double a, double b, param_t &pa) {
00043 double res, err;
00044 integ_err(func,a,b,pa,res,err);
00045 this->interror=err;
00046 return res;
00047 }
00048
00049
00050
00051
00052 virtual int integ_err(func_t &func, double a, double b,
00053 param_t &pa, double &res, double &err2) {
00054
00055 double fv1[11], fv2[11];
00056
00057 int status=qags(func,11,o2scl_inte_qag_coeffs::qk21_xgk,
00058 o2scl_inte_qag_coeffs::qk21_wg,
00059 o2scl_inte_qag_coeffs::qk21_wgk,
00060 fv1,fv2,a,b,this->tolx,this->tolf,this->wkspace,
00061 &res,&err2,pa);
00062
00063 return status;
00064
00065 }
00066
00067
00068 };
00069
00070 #ifndef DOXYGENP
00071 }
00072 #endif
00073
00074 #endif