23char xdsdx_mat_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Non_class_members/PDE/xdsdx_mat.C,v 1.5 2014/10/13 08:53:31 j_novak Exp $" ;
65#include "type_parite.h"
73Matrice _xdsdx_mat_pas_prevu(
int n,
int) {
74 cout <<
"xdsdx_mat pas prevu..." << endl ;
75 cout <<
"n : " << n << endl ;
88Matrice _xdsdx_mat_r_chebp (
int n,
int) {
89 const int nmax = 200 ;
90 static Matrice* tab[nmax] ;
91 static int nb_dejafait = 0 ;
92 static int nr_dejafait[nmax] ;
97 for (
int conte=0 ; conte<nb_dejafait ; conte ++)
98 if (nr_dejafait[conte] == n)
103 if (nb_dejafait >= nmax) {
104 cout <<
"_laplacien_nul_mat_r_chebp : trop de matrices" << endl ;
109 nr_dejafait[nb_dejafait] = n ;
111 Matrice res(n-1, n-1) ;
114 double* xdsdx =
new double[n] ;
116 for (
int i=0 ; i<n-1 ; i++) {
117 for (
int j=0 ; j<n ; j++)
121 xdsdx_1d (n, &xdsdx,
R_CHEBP) ;
123 for (
int j=0 ; j<n-1 ; j++)
124 res.set(j, i) = xdsdx[j] ;
127 tab[nb_dejafait] =
new Matrice(res) ;
133 return *tab[indice] ;
143Matrice _xdsdx_mat_r_chebi (
int n,
int l) {
144 const int nmax = 200 ;
145 static Matrice* tab[nmax] ;
146 static int nb_dejafait = 0 ;
147 static int nr_dejafait[nmax] ;
148 static int nl_dejafait[nmax] ;
152 int indic_l = (l == 1) ? 1 : 2 ;
155 for (
int conte=0 ; conte<nb_dejafait ; conte ++)
156 if ((nr_dejafait[conte] == n) && (nl_dejafait[conte] == indic_l))
161 if (nb_dejafait >= nmax) {
162 cout <<
"_laplacien_nul_mat_r_chebp : trop de matrices" << endl ;
167 nr_dejafait[nb_dejafait] = n ;
168 nl_dejafait[nb_dejafait] = indic_l ;
171 int taille = (l==1) ? n : n-1 ;
172 Matrice res(taille, taille) ;
175 double* xdsdx =
new double[n] ;
177 for (
int i=0 ; i<taille ; i++) {
178 for (
int j=0 ; j<n ; j++)
189 xdsdx_1d (n, &xdsdx,
R_CHEBI) ;
191 for (
int j=0 ; j<taille ; j++)
192 res.set(j, i) = xdsdx[j] ;
196 tab[nb_dejafait] =
new Matrice(res) ;
202 return *tab[indice] ;
209Matrice xdsdx_mat(
int n,
int l,
int base_r)
213 static Matrice (*xdsdx_mat[
MAX_BASE])(int, int) ;
220 xdsdx_mat[i] = _xdsdx_mat_pas_prevu ;
227 Matrice res(xdsdx_mat[base_r](n, l)) ;
#define MAX_BASE
Nombre max. de bases differentes.
#define R_CHEBI
base de Cheb. impaire (rare) seulement
#define TRA_R
Translation en R, used for a bitwise shift (in hex)
#define R_CHEBP
base de Cheb. paire (rare) seulement