66 #include "type_parite.h" 87 void _sxpun_1d_pas_prevu(
int nr,
double* tb,
double *res) {
88 cout <<
"sxpun pas prevu..." << endl ;
89 cout <<
" valeurs: " << tb <<
" " << res << endl ;
90 cout <<
"nr : " << nr << endl ;
101 void _sxpun_1d_r_cheb (
int nr,
double* tb,
double *xo)
107 xo[nr-2] = 2*(tb[nr-1]-xo[nr-1]) ;
109 for (
int i=nr-3 ; i>0 ; i--)
110 xo[i] = 2*tb[i+1]-2*xo[i+1]-xo[i+2] ;
113 for (
int i=0 ; i<nr ; i++)
119 xo[0] = tb[0]-xo[1]/2.-somme ;
127 void _sxpun_1d_r_jaco02 (
int nr,
double* tb,
double* xo)
132 for (
int i = 0 ; i < nr-1 ; i++) {
134 for (
int j = i+1 ; j < nr ; j++) {
135 int signe = ((j-1-i)%2 == 0 ? 1 : -1) ;
136 somme += signe*((j+1)*(j+2)/double((i+1)*(i+2))-(i+1)*(i+2)/double((j+1)*(j+2)))*tb[j] ;
138 xo[i] = (2*i+3)/
double(4)*somme ;
147 void sxpun_1d(
int nr,
double **tb,
int base_r)
151 static void (*sxpun_1d[
MAX_BASE])(int,
double *,
double *) ;
158 sxpun_1d[i] = _sxpun_1d_pas_prevu ;
165 double *result =
new double[nr] ;
166 sxpun_1d[base_r](nr, *tb, result) ;
#define R_JACO02
base de Jacobi(0,2) ordinaire (finjac)
#define TRA_R
Translation en R, used for a bitwise shift (in hex)
#define MAX_BASE
Nombre max. de bases differentes.
#define R_CHEB
base de Chebychev ordinaire (fin)