28char prepa_ptens_rr_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Ope_elementary/Ope_pois_vect_r/prepa_ptens_rr.C,v 1.3 2014/10/13 08:53:34 j_novak Exp $" ;
52#include "type_parite.h"
70Matrice _nondeg_ptens_rr_pas_prevu(
const Matrice &,
int ,
double,
int) ;
71Matrice _nondeg_ptens_rr_cheb (
const Matrice&,
int,
double,
int) ;
72Matrice _nondeg_ptens_rr_chebp (
const Matrice&,
int,
double,
int) ;
73Matrice _nondeg_ptens_rr_chebi (
const Matrice&,
int,
double,
int) ;
74Matrice _nondeg_ptens_rr_chebu (
const Matrice&,
int,
double,
int) ;
81Matrice _nondeg_ptens_rr_pas_prevu(
const Matrice &lap,
int l,
double echelle,
int puis) {
82 cout <<
"Construction non degeneree pas prevue..." << endl ;
83 cout <<
"l : " << l << endl ;
84 cout <<
"lap : " << lap << endl ;
85 cout <<
"echelle : " << echelle << endl ;
86 cout <<
" puis : " << puis << endl ;
99Matrice _nondeg_ptens_rr_cheb (
const Matrice &lap,
int l,
double echelle,
int) {
104 const int nmax = 200 ;
105 static Matrice* tab[nmax] ;
106 static int nb_dejafait = 0 ;
107 static int l_dejafait[nmax] ;
108 static int nr_dejafait[nmax] ;
109 static double vieux_echelle = 0;
112 if (vieux_echelle != echelle) {
113 for (
int i=0 ; i<nb_dejafait ; i++) {
115 nr_dejafait[i] = -1 ;
118 vieux_echelle = echelle ;
125 for (
int conte=0 ; conte<nb_dejafait ; conte ++)
126 if ((l_dejafait[conte] == l) && (nr_dejafait[conte] == n))
131 if (nb_dejafait >= nmax) {
132 cout <<
"_nondeg_ptens_rr_cheb : trop de matrices" << endl ;
138 l_dejafait[nb_dejafait] = l ;
139 nr_dejafait[nb_dejafait] = n ;
144 Matrice res(n-2, n-2) ;
146 for (
int i=0 ; i<n-2 ; i++)
147 for (
int j=0 ; j<n-2 ; j++)
148 res.set(i, j) = lap(i, j+2) ;
152 tab[nb_dejafait] =
new Matrice(res) ;
159 return *tab[indice] ;
169Matrice _nondeg_ptens_rr_chebp (
const Matrice &lap,
int l,
double,
int) {
174 const int nmax = 200 ;
175 static Matrice* tab[nmax] ;
176 static int nb_dejafait = 0 ;
177 static int l_dejafait[nmax] ;
178 static int nr_dejafait[nmax] ;
183 for (
int conte=0 ; conte<nb_dejafait ; conte ++)
184 if ((l_dejafait[conte] == l) && (nr_dejafait[conte] == n))
189 if (nb_dejafait >= nmax) {
190 cout <<
"_nondeg_ptens_rr_chebp : trop de matrices" << endl ;
196 l_dejafait[nb_dejafait] = l ;
197 nr_dejafait[nb_dejafait] = n ;
202 Matrice res(n-1, n-1) ;
204 for (
int i=0 ; i<n-1 ; i++)
205 for (
int j=0 ; j<n-1 ; j++)
206 res.set(i, j) = lap(i, j+1) ;
209 tab[nb_dejafait] =
new Matrice(res) ;
214 Matrice res(n-2, n-2) ;
216 for (
int i=0 ;i<n-2 ; i++)
217 for (
int j=0 ; j<n-2 ; j++)
218 res.set(i, j) = lap(i, j+2) ;
222 tab[nb_dejafait] =
new Matrice(res) ;
229 return *tab[indice] ;
239Matrice _nondeg_ptens_rr_chebi (
const Matrice &lap,
int l,
double,
int) {
243 const int nmax = 200 ;
244 static Matrice* tab[nmax] ;
245 static int nb_dejafait = 0 ;
246 static int l_dejafait[nmax] ;
247 static int nr_dejafait[nmax] ;
252 for (
int conte=0 ; conte<nb_dejafait ; conte ++)
253 if ((l_dejafait[conte] == l) && (nr_dejafait[conte] == n))
258 if (nb_dejafait >= nmax) {
259 cout <<
"_nondeg_ptens_rr_chebi : trop de matrices" << endl ;
265 l_dejafait[nb_dejafait] = l ;
266 nr_dejafait[nb_dejafait] = n ;
272 Matrice res(n-2, n-2) ;
274 for (
int i=0 ;i<n-2 ; i++)
275 for (
int j=0 ; j<n-2 ; j++)
276 res.set(i, j) = lap(i, j+2) ;
280 tab[nb_dejafait] =
new Matrice(res) ;
286 return *tab[indice] ;
297Matrice _nondeg_ptens_rr_chebu (
const Matrice &lap,
int l,
double,
int puis) {
300 cout <<
"_ope_ptens_rr_mat_r_chebu : only the case dzpuis = 4 "
301 <<
'\n' <<
"is implemented! \n"
302 <<
"dzpuis = " << puis << endl ;
305 int n = lap.get_dim(0) ;
307 const int nmax = 200;
308 static Matrice* tab[nmax] ;
309 static int nb_dejafait = 0 ;
310 static int l_dejafait[nmax] ;
311 static int nr_dejafait[nmax] ;
316 for (
int conte=0 ; conte<nb_dejafait ; conte ++)
317 if ((l_dejafait[conte] == l) && (nr_dejafait[conte] == n))
322 if (nb_dejafait >= nmax) {
323 cout <<
"_nondeg_ptens_rr_chebu : trop de matrices" << endl ;
328 l_dejafait[nb_dejafait] = l ;
329 nr_dejafait[nb_dejafait] = n ;
331 Matrice res(n-3, n-3) ;
333 for (
int i=0 ;i<n-3 ; i++)
334 for (
int j=0 ; j<n-3 ; j++)
335 res.set(i, j) = lap(i, j+3) ;
339 tab[nb_dejafait] =
new Matrice(res) ;
346 return *tab[indice] ;
355Matrice nondeg_ptens_rr(
const Matrice &lap,
int l,
double echelle,
int puis,
int base_r)
359 static Matrice (*nondeg_ptens_rr[
MAX_BASE])(
const Matrice&, int, double, int) ;
366 nondeg_ptens_rr[i] = _nondeg_ptens_rr_pas_prevu ;
369 nondeg_ptens_rr[
R_CHEB >>
TRA_R] = _nondeg_ptens_rr_cheb ;
370 nondeg_ptens_rr[
R_CHEBU >>
TRA_R] = _nondeg_ptens_rr_chebu ;
371 nondeg_ptens_rr[
R_CHEBP >>
TRA_R] = _nondeg_ptens_rr_chebp ;
372 nondeg_ptens_rr[
R_CHEBI >>
TRA_R] = _nondeg_ptens_rr_chebi ;
375 Matrice res(nondeg_ptens_rr[base_r](lap, l, echelle, puis)) ;
int get_dim(int i) const
Returns the dimension of the matrix.
#define MAX_BASE
Nombre max. de bases differentes.
#define R_CHEBU
base de Chebychev ordinaire (fin), dev. en 1/r
#define R_CHEBI
base de Cheb. impaire (rare) seulement
#define TRA_R
Translation en R, used for a bitwise shift (in hex)
#define R_CHEB
base de Chebychev ordinaire (fin)
#define R_CHEBP
base de Cheb. paire (rare) seulement