63 #include "type_parite.h" 85 void _sxdsdx_1d_pas_prevu(
int nr,
double* tb,
double *res) {
86 cout <<
"sxdsdx pas prevu..." << endl ;
87 cout <<
" valeurs: " << tb <<
" " << res << endl ;
88 cout <<
"nr : " << nr << endl ;
99 void _dsdx_1d_r_cheb(
int nr,
double* tb,
double *xo)
105 som = 2*(nr-1) * tb[nr-1] ;
107 for (
int i = nr-4 ; i >= 0 ; i -= 2 ) {
108 som += 2*(i+1) * tb[i+1] ;
111 som = 2*(nr-2) * tb[nr-2] ;
113 for (
int i = nr-5 ; i >= 0 ; i -= 2 ) {
114 som += 2*(i+1) * tb[i+1] ;
125 void sxm1_1d_cheb (
int,
double*) ;
127 void _sxmundsdx_1d_r_chebu(
int nr,
double* tb,
double *xo)
133 som = 2*(nr-1) * tb[nr-1] ;
135 for (
int i = nr-4 ; i >= 0 ; i -= 2 ) {
136 som += 2*(i+1) * tb[i+1] ;
139 som = 2*(nr-2) * tb[nr-2] ;
141 for (
int i = nr-5 ; i >= 0 ; i -= 2 ) {
142 som += 2*(i+1) * tb[i+1] ;
147 sxm1_1d_cheb (nr, xo) ;
154 void _sxdsdx_1d_r_chebp(
int nr,
double* tb,
double *xo)
160 som = 8 * (nr-1) * tb[nr-1] ;
162 for (
int i = nr-4 ; i >= 0 ; i -= 2 ) {
163 som += 8 * (i+1) * tb[i+1] ;
167 som = 8 * (nr-2) * tb[nr-2] ;
169 for (
int i = nr-5 ; i >= 0 ; i -= 2 ) {
170 som += 8 * (i+1) * tb[i+1] ;
182 void _sxdsdx_1d_r_chebi(
int nr,
double* tb,
double *xo)
189 som = 4 * (2*(nr-1)+1) * tb[nr-1] ;
191 for (
int i = nr-4 ; i >= 0 ; i -= 2 ) {
192 som += 4 * (2*(i+1)+1) * tb[i+1] ;
196 som = 4 * (2*(nr-2)+1) * tb[nr-2] ;
198 for (
int i = nr-5 ; i >= 0 ; i -= 2 ) {
199 som += 4 * (2*(i+1)+1) * tb[i+1] ;
211 void sxdsdx_1d(
int nr,
double **tb,
int base_r)
215 static void (*sxdsdx_1d[
MAX_BASE])(int,
double *,
double *) ;
222 sxdsdx_1d[i] = _sxdsdx_1d_pas_prevu ;
231 double *result =
new double[nr] ;
232 sxdsdx_1d[base_r](nr, *tb, result) ;
#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_CHEB
base de Chebychev ordinaire (fin)