66 #include "type_parite.h" 82 void _sx_1d_r_legp(
int,
double* ,
double *) ;
83 void _sx_1d_r_legi(
int,
double* ,
double *) ;
90 void _sx2_1d_pas_prevu(
int nr,
double* tb,
double *res) {
91 cout <<
"sx2 pas prevu..." << tb <<
" " << res << endl ;
92 cout <<
"nr : " << nr << endl ;
102 void _sx2_1d_identite(
int nr,
double*tb ,
double *res) {
103 for (
int i=0 ; i<nr ; i++)
112 void _sx2_1d_r_chebp(
int nr,
double* tb,
double *xo)
121 somp = 4 * sgn * (nr-1) * tb[nr-1] ;
122 somn = 2 * sgn * tb[nr-1] ;
123 xo[nr-2] = somp - 2*(nr-2)*somn ;
124 for (
int i = nr-3 ; i >= 0 ; i-- ) {
126 somp += 4 * (i+1) * sgn * tb[i+1] ;
127 somn += 2 * sgn * tb[i+1] ;
128 xo[i] = somp - 2*i * somn ;
130 for (
int i=0 ; i<nr ; i+=2) {
142 void _sx2_1d_r_chebi(
int nr,
double* tb,
double *xo)
148 somp = 2 * sgn * (2*(nr-1)+1) * tb[nr-1] ;
149 somn = 2 * sgn * tb[nr-1] ;
150 xo[nr-2] = somp - (2*(nr-2)+1)*somn ;
151 for (
int i = nr-3 ; i >= 0 ; i-- ) {
153 somp += 2 * (2*(i+1)+1) * sgn * tb[i+1] ;
154 somn += 2 * sgn * tb[i+1] ;
155 xo[i] = somp - (2*i+1) * somn ;
157 for (
int i=0 ; i<nr ; i+=2) {
166 void _sxm12_1d_r_chebu(
int nr,
double* tb,
double *xo) {
169 sxm1_1d_cheb(nr, tb) ;
170 sxm1_1d_cheb(nr, tb) ;
171 for (
int i=0 ; i<nr ; i++)
179 void _sx2_1d_r_legp(
int nr,
double* tb,
double *xo)
182 double* interm =
new double[nr] ;
183 _sx_1d_r_legp(nr, tb, interm) ;
184 _sx_1d_r_legi(nr, interm, xo) ;
194 void _sx2_1d_r_legi(
int nr,
double* tb,
double *xo)
197 double* interm =
new double[nr] ;
198 _sx_1d_r_legi(nr, tb, interm) ;
199 _sx_1d_r_legp(nr, interm, xo) ;
207 void sx2_1d(
int nr,
double **tb,
int base_r)
211 static void (*sx2_1d[
MAX_BASE])(int,
double *,
double*) ;
218 sx2_1d[i] = _sx2_1d_pas_prevu ;
230 double *result =
new double[nr] ;
231 sx2_1d[base_r](nr, *tb, result) ;
#define R_LEGP
base de Legendre paire (rare) seulement
#define R_LEGI
base de Legendre impaire (rare) seulement
#define TRA_R
Translation en R, used for a bitwise shift (in hex)
#define R_CHEBI
base de Cheb. impaire (rare) seulement
#define R_CHEBP
base de Cheb. paire (rare) seulement
#define R_CHEBU
base de Chebychev ordinaire (fin), dev. en 1/r
#define MAX_BASE
Nombre max. de bases differentes.
#define R_LEG
base de Legendre ordinaire (fin)
#define R_CHEB
base de Chebychev ordinaire (fin)