66 #include "type_parite.h" 85 void _dsdx_1d_pas_prevu(
int nr,
double* tb,
double *xo) {
86 cout <<
"dsdx pas prevu..." << endl ;
87 cout <<
"Nombre de points : " << nr << endl ;
88 cout <<
"Valeurs : " << tb <<
" " << xo <<endl ;
97 void _dsdx_1d_r_chebu(
int nr,
double* tb,
double *xo)
103 som = 2*(nr-1) * tb[nr-1] ;
105 for (
int i = nr-4 ; i >= 0 ; i -= 2 ) {
106 som += 2*(i+1) * tb[i+1] ;
109 som = 2*(nr-2) * tb[nr-2] ;
111 for (
int i = nr-5 ; i >= 0 ; i -= 2 ) {
112 som += 2*(i+1) * tb[i+1] ;
124 void _dsdx_1d_r_jaco02(
int nr,
double* tb,
double *xo)
130 for (
int i = 0 ; i < nr-1 ; i++ ) {
132 for (
int j = i+1 ; j < nr ; j++ ) {
133 som += (1 -
pow(
double(-1),(j-i))*(i+1)*(i+2)/double((j+1)*(j+2)))*tb[j] ;
135 xo[i] = (i+1.5)*som ;
144 void _dsdx_1d_r_chebi(
int nr,
double* tb,
double *xo)
150 som = 2*(2*nr-3) * tb[nr-2] ;
152 for (
int i = nr-3 ; i >= 0 ; i -- ) {
153 som += 2*(2*i+1) * tb[i] ;
163 void _dsdx_1d_r_chebp(
int nr,
double* tb,
double *xo)
169 som = 4*(nr-1) * tb[nr-1] ;
171 for (
int i = nr-3 ; i >= 0 ; i --) {
172 som += 4*(i+1) * tb[i+1] ;
181 void _dsdx_1d_r_leg(
int nr,
double* tb,
double *xo)
187 xo[nr-2] = double(2*nr-3)*som ;
188 for (
int i = nr-4 ; i >= 0 ; i -= 2 ) {
190 xo[i] = double(2*i+1)*som ;
193 if (nr > 2) xo[nr-3] = double(2*nr-5)*som ;
194 for (
int i = nr-5 ; i >= 0 ; i -= 2 ) {
196 xo[i] = double(2*i+1)*som ;
204 void _dsdx_1d_r_legi(
int nr,
double* tb,
double *xo)
211 if (nr > 1) xo[nr-2] = double(4*nr-7)*som ;
212 for (
int i = nr-3 ; i >= 0 ; i -- ) {
214 xo[i] = double(4*i+1)*som ;
222 void _dsdx_1d_r_legp(
int nr,
double* tb,
double *xo)
229 if (nr > 1) xo[nr-2] = double(4*nr-5)*som ;
230 for (
int i = nr-3 ; i >= 0 ; i --) {
232 xo[i] = double(4*i+3)*som ;
241 void dsdx_1d(
int nr,
double** tb,
int base_r)
245 static void (*dsdx_1d[
MAX_BASE])(int,
double*,
double *) ;
252 dsdx_1d[i] = _dsdx_1d_pas_prevu ;
266 double *result =
new double[nr] ;
268 dsdx_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 R_JACO02
base de Jacobi(0,2) ordinaire (finjac)
#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
Cmp pow(const Cmp &, int)
Power .
#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)