54 #include "type_parite.h" 78 void _sx_1d_pas_prevu(
int ,
double* ,
double *) {
79 cout <<
"sx_1d : base not implemented..." << endl ;
89 void _sx_1d_r_chebp (
int nr,
double* tb,
double* res) {
94 som = 2 * sign * tb[nr-1] ;
96 for (
int i=nr-3 ; i>=0 ; i--) {
98 som += 2 * sign * tb[i+1] ;
99 res[i] = (i%2 == 0 ? -1 : 1) * som ;
109 void _sx_1d_r_chebi (
int nr,
double* tb,
double* res) {
114 som = 2 * sign * tb[nr-2] ;
116 for (
int i=nr-3 ; i>=0 ; i--) {
118 som += 2 * sign * tb[i] ;
119 res[i] = (i%2 == 0 ? -1 : 1) * som ;
128 void _sx_1d_r_chebu (
int nr,
double* tb,
double* res) {
130 for (
int i=0; i<nr; i++)
133 sxm1_1d_cheb(nr, res) ;
141 void _sx_1d_r_legp (
int nr,
double* tb,
double* res) {
145 for (
int i=nr-2 ; i>=0 ; i--) {
147 res[i] = double(4*i+3)/double(2*i+2)*term ;
148 term *= -double(2*i+1)/double(2*i+2) ;
158 void _sx_1d_r_legi (
int nr,
double* tb,
double* res) {
162 for (
int i=nr-2; i>=0; i--) {
164 res[i] = double(4*i+1)/double(2*i+1)*term ;
165 term *= -double(2*i)/double(2*i+1) ;
175 void sx_1d(
int nr,
double **tb,
int base_r)
178 static void (*sx_1d[
MAX_BASE])(int,
double *,
double *) ;
185 sx_1d[i] = _sx_1d_pas_prevu ;
196 double *result =
new double[nr] ;
197 sx_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.