6 double* jacobi(
int ,
double) ;
8 double* pointsgausslobatto(
int n) {
11 int ndiv = (n+1)*(n+1)+5 ;
12 double pas = double(2)/double(ndiv-1) ;
13 double eps = 2.5E-12 ;
16 subdiv.set_etat_qcq();
19 double* xx =
new double[nmax] ;
24 for (i = 0 ; i < ndiv ; i++) {
25 subdiv.set(i) = double(-1) + pas * double(i) ;
28 double a = (2*double(n)+3)/
double((n+1)*(n+1)) ;
33 for (i = 1 ; i < ndiv-3 ; i++) {
34 yy = jacobi(n+1 , subdiv(i)) ;
35 zz = jacobi(n+1 , subdiv(i+1)) ;
36 double omega1 = yy[n+1] + a * yy[n] + b * yy[n-1] ;
37 double omega2 = zz[n+1] + a * zz[n] + b * zz[n-1] ;
38 if (omega1*omega2 <= 0) {
39 cs.set(j,0) = subdiv(i) ;
40 cs.set(j,1) = subdiv(i+1) ;
49 double* pointsgl =
new double[j+2];
53 for (l = 0 ; l < j ; l++) {
56 for (k = 2 ; k < nmax ; k++) {
57 yy = jacobi(n+1 , xx[k-2]) ;
58 zz = jacobi(n+1 , xx[k-1]) ;
59 double omega1 = yy[n+1] + a * yy[n] + b * yy[n-1] ;
60 double omega2 = zz[n+1] + a * zz[n] + b * zz[n-1] ;
61 if (( fabs(xx[k-2]-xx[k-1])>=eps )&&(fabs(omega2)>=eps )) {
62 xx[k]=(xx[k-2]*omega2 -xx[k-1]*omega1)/(omega2-omega1) ;
70 pointsgl[l+1] = xx[nmax-1] ;