13 #include "mg/defintArea.h"
45 MGDefintArea::instance().init();
46 int npow=MGDefintArea::instance().m_npow, nend=MGDefintArea::instance().m_nend;
47 double *a0=MGDefintArea::instance().m_a0,
48 *am=MGDefintArea::instance().m_am,
49 *ap=MGDefintArea::instance().m_ap;
50 double b0=MGDefintArea::instance().m_b0, *bb=MGDefintArea::instance().m_bb;
51 double eps0=MGDefintArea::instance().m_eps0;
63 const int lp1 = l + 1;
64 const int id=lp1*mgdefintlen-(mgdefintlen+1);
70 double epsq = sqrt(epsv) * .2;
72 d = a0[l] * fac + shfp;
73 double vnew = f(d) * b0;
78 int is=1; is=is<<npow;
80 int km=0, kp=0, nm=0, np=0;
81 for(i=is; im<0 ? i>=nend : i<=nend; i+=im){
84 d = am[i+id]*fac + shfm;
89 if (km >= 2) nm = i - im;
94 d = ap[i+id]*fac + shfp;
108 double epsm = 0., epsp = 0.;
111 epsm = sqrt(fabs(wm));
116 epsp = sqrt(fabs(wp));
125 double vold = h * fac * vnew;
126 for(
int mstep = 1; mstep<=npow; ++mstep){
131 for(i=is; ih<0 ? i>=nm : i<=nm; i+=ih) {
132 d = am[i+id] * fac + shfm;
133 vnew += f(d) * bb[i - 1];
136 for(i=is; ih<0 ? i>=np : i<=np; i+=ih) {
137 d = ap[i+id] * fac + shfp;
138 vnew += f(d) * bb[i-1];
141 vnew = (vold + h*fac*vnew) * .5;
142 if((d=vnew-vold,fabs(d))<epsq)
double mgDefint(func &f, double a, double b, double eps, int l=0)
Integrate f(x)(l=0) or F(x)(l=1, see below) over finite interval (a,b). The DE formula (double expone...
Definition: defint.h:24