53 if (ff.get_etat() != ETATZERO) {
56 assert (ff.get_etat() == ETATQCQ) ;
59 assert (ff.get_taille() == nx) ;
63 double x1(0), x2(0), x3(0);
64 double a1(0), a2(0), a3(0);
65 double b1(0), b2(0), b3(0);
66 double c1(0), c2(0), c3(0) ;
68 for (
int i=1; i<nx-1; i++) {
72 a1 = ff(i-1) / ( (x1 - x2)*(x1 - x3) ) ;
73 a2 = ff(i) / ( (x2 - x1)*(x2 - x3) ) ;
74 a3 = ff(i+1) / ( (x3 - x1)*(x3 - x2) ) ;
76 b2 = -(x2 + x3)*a1 - (x1 + x3)*a2 - (x1 + x2)*a3 ;
77 b3 = x2*x3*a1 + x1*x3*a2 + x1*x2*a3 ;
88 resu.
set(i) = resu(i-1) + c1*(x2*x2*x2 - x0*x0*x0)/3.
89 + 0.5*c2*(x2*x2 - x0*x0) + c3*(x2 - x0) ;
97 resu.
set(nx-1) = resu(nx-2) + c1*(x2*x2*x2 - x0*x0*x0)/3.
98 + 0.5*c2*(x2*x2 - x0*x0) + c3*(x2 - x0) ;
double & set(int i)
Read/write of a particular element (index i) (1D case)
int get_etat() const
Gives the logical state.
Tbl integ1D(const Tbl &xx, const Tbl &ff)
Integrates a function defined on an unequally-spaced grid, approximating it by piecewise parabolae...
int get_taille() const
Gives the total size (ie dim.taille)