28 REAL
integrate(T &func,
const REAL a,
const REAL b);
38 REAL
adaptlob(T &func,
const REAL a,
const REAL b,
const REAL fa,
const REAL fb,
const REAL is);
41 REAL
adaptlob(T &func,
const int pos,
const REAL a,
const REAL b,
const REAL fa,
const REAL fb,
const REAL is);
51 const REAL EPS = std::numeric_limits<REAL>::epsilon();
66 REAL
m,
h,fa,fb,i1,i2,is,erri1,erri2,r,y[13];
71 for(
int i = 1; i < 12; i++ )
73 y[i] = func(m +
x[i] * h);
75 i2 = (h/6.0) * (y[0] + y[12] + 5.0 * (y[4] + y[8]));
76 i1 = (h/1470.0) * (77.0 * (y[0] + y[12]) + 432.0 * (y[2] + y[10]) + 625.0 * (y[4] + y[8]) + 672.0 * y[6]);
77 is = h * (0.0158271919734802 * (y[0] + y[12]) + 0.0942738402188500 * (y[1] + y[11]) + 0.155071987336585 * (y[2] + y[10]) +
78 0.188821573960182 * (y[3] + y[9]) + 0.199773405226859 * (y[4] + y[8]) + 0.224926465333340 * (y[5] + y[7]) + 0.242611071901408 * y[6]);
81 r = (erri2 != 0.0) ? erri1/erri2 : 1.0;
89 REAL answ =
adaptlob(func,a,b,fa,fb,is);
101 REAL
m,
h,fa,fb,i1,i2,is,erri1,erri2,r,y[13];
106 for(
int i = 1; i < 12; i++ )
108 FUNCTy[i] = func(m +
x[i] * h);
110 FUNCTy[12] = func(b);
112 for(
int d = 0; d < dim; d++)
114 fa = y[0] = FUNCTy[0][d];
115 fb = y[12] = FUNCTy[12][d];
116 for(
int i = 1; i < 12; i++ )
120 i2 = (h/6.0) * (y[0] + y[12] + 5.0 * (y[4] + y[8]));
121 i1 = (h/1470.0) * (77.0 * (y[0] + y[12]) + 432.0 * (y[2] + y[10]) + 625.0 * (y[4] + y[8]) + 672.0 * y[6]);
122 is = h * (0.0158271919734802 * (y[0] + y[12]) + 0.0942738402188500 * (y[1] + y[11]) + 0.155071987336585 * (y[2] + y[10]) +
123 0.188821573960182 * (y[3] + y[9]) + 0.199773405226859 * (y[4] + y[8]) + 0.224926465333340 * (y[5] + y[7]) + 0.242611071901408 * y[6]);
126 r = (erri2 != 0.0) ? erri1/erri2 : 1.0;
134 REAL answ =
adaptlob(func,d,a,b,fa,fb,is);
143 inline REAL
Adapt::adaptlob(T &func,
const REAL a,
const REAL b,
const REAL fa,
const REAL fb,
const REAL is)
145 REAL
m,
h,mll,ml,mr,mrr,fmll,fml,fm,fmrr,fmr,i1,i2;
157 i2 = h/6.0 * (fa + fb + 5.0 * (fml + fmr));
158 i1 = h/1470.0 * (77.0 * (fa + fb) + 432.0 * (fmll + fmrr) + 625.0 * (fml + fmr) + 672.0 * fm);
170 REAL
val =
adaptlob(func,a,mll,fa,fmll,is) +
adaptlob(func,mll,ml,fmll,fml,is) +
adaptlob(func,ml,m,fml,fm,is) +
171 adaptlob(func,m,mr,fm,fmr,is) +
adaptlob(func,mr,mrr,fmr,fmrr,is) +
adaptlob(func,mrr,b,fmrr,fb,is);
178 inline REAL
Adapt::adaptlob(T &func,
const int pos,
const REAL a,
const REAL b,
const REAL fa,
const REAL fb,
const REAL is)
180 REAL
m,
h,mll,ml,mr,mrr,fmll,fml,fm,fmrr,fmr,i1,i2;
187 fmll = func(mll)[pos];
191 fmrr = func(mrr)[pos];
192 i2 = h/6.0 * (fa + fb + 5.0 * (fml + fmr));
193 i1 = h/1470.0 * (77.0 * (fa + fb) + 432.0 * (fmll + fmrr) + 625.0 * (fml + fmr) + 672.0 * fm);
205 REAL
val =
adaptlob(func,pos,a,mll,fa,fmll,is) +
adaptlob(func,pos,mll,ml,fmll,fml,is) +
adaptlob(func,pos,ml,m,fml,fm,is) +
206 adaptlob(func,pos,m,mr,fm,fmr,is) +
adaptlob(func,pos,mr,mrr,fmr,fmrr,is) +
adaptlob(func,pos,mrr,b,fmrr,fb,is);
REAL adaptlob(T &func, const REAL a, const REAL b, const REAL fa, const REAL fb, const REAL is)
REAL integrate(T &func, const REAL a, const REAL b)
Templated vector implementation.
TPZVec< REAL > Vintegrate(T &func, const int dim, const REAL a, const REAL b)
clarg::argBool h("-h", "help message", false)
TinyFad< 8, T > abs(const TinyFad< 8, T > &in)
REAL val(STATE &number)
Returns value of the variable.
void SetPrecision(REAL tol)
Contains the declaration of TPZFlopCounter class and TPZCounter struct.
clarg::argString m("-m", "input matrix file name (text format)", "matrix.txt")