32#include "ope_elementary.h"
40Matrice _poisson_2d_non_dege_pas_prevu(
const Matrice &lap,
int,
double,
int) {
41 cout <<
"Construction non degeneree pas prevue..." << endl ;
53Matrice _poisson_2d_non_dege_r_cheb (
const Matrice &lap,
int l,
double echelle,
int) {
58 const int nmax = 200 ;
60 static int nb_dejafait = 0 ;
61 static int l_dejafait[nmax] ;
62 static int nr_dejafait[nmax] ;
63 static double vieux_echelle = 0;
66 if (vieux_echelle != echelle) {
67 for (
int i=0 ; i<nb_dejafait ; i++) {
72 vieux_echelle = echelle ;
79 for (
int conte=0 ; conte<nb_dejafait ; conte ++)
80 if ((l_dejafait[conte] == l) && (nr_dejafait[conte] == n))
85 if (nb_dejafait >= nmax) {
86 cout <<
"_poisson_2d_non_dege_r_cheb : trop de matrices" << endl ;
92 l_dejafait[nb_dejafait] = l ;
93 nr_dejafait[nb_dejafait] = n ;
100 for (
int i=0 ; i<n-2 ; i++)
101 for (
int j=0 ; j<n-2 ; j++)
102 res.set(i, j) = lap(i, j+2) ;
106 tab[nb_dejafait] =
new Matrice(res) ;
113 return *tab[indice] ;
123Matrice _poisson_2d_non_dege_r_chebp (
const Matrice &lap,
int l,
double,
int) {
128 const int nmax = 200 ;
130 static int nb_dejafait = 0 ;
131 static int l_dejafait[nmax] ;
132 static int nr_dejafait[nmax] ;
137 for (
int conte=0 ; conte<nb_dejafait ; conte ++)
138 if ((l_dejafait[conte] == l) && (nr_dejafait[conte] == n))
143 if (nb_dejafait >= nmax) {
144 cout <<
"_poisson_2d_non_dege_r_chebp : trop de matrices" << endl ;
150 l_dejafait[nb_dejafait] = l ;
151 nr_dejafait[nb_dejafait] = n ;
153 assert (div(l, 2).rem == 0) ;
159 for (
int i=0 ; i<n-1 ; i++)
160 for (
int j=0 ; j<n-1 ; j++)
161 res.set(i, j) = lap(i, j+1) ;
164 tab[nb_dejafait] =
new Matrice(res) ;
171 for (
int i=0 ;i<n-2 ; i++)
172 for (
int j=0 ; j<n-2 ; j++)
173 res.set(i, j) = lap(i, j+2) ;
177 tab[nb_dejafait] =
new Matrice(res) ;
184 return *tab[indice] ;
194Matrice _poisson_2d_non_dege_r_chebi (
const Matrice &lap,
int l,
double,
int) {
198 const int nmax = 200 ;
200 static int nb_dejafait = 0 ;
201 static int l_dejafait[nmax] ;
202 static int nr_dejafait[nmax] ;
207 for (
int conte=0 ; conte<nb_dejafait ; conte ++)
208 if ((l_dejafait[conte] == l) && (nr_dejafait[conte] == n))
213 if (nb_dejafait >= nmax) {
214 cout <<
"_poisson_2d_non_dege_r_chebi : trop de matrices" << endl ;
220 l_dejafait[nb_dejafait] = l ;
221 nr_dejafait[nb_dejafait] = n ;
224 assert (div(l, 2).rem == 1) ;
230 for (
int i=0 ; i<n-1 ; i++)
231 for (
int j=0 ; j<n-1 ; j++)
232 res.set(i, j) = lap(i, j+1) ;
235 tab[nb_dejafait] =
new Matrice(res) ;
242 for (
int i=0 ;i<n-2 ; i++)
243 for (
int j=0 ; j<n-2 ; j++)
244 res.set(i, j) = lap(i, j+2) ;
248 tab[nb_dejafait] =
new Matrice(res) ;
255 return *tab[indice] ;
264Matrice _poisson_2d_non_dege_r_chebu_quatre (
const Matrice&,
int) ;
268Matrice _poisson_2d_non_dege_r_chebu (
const Matrice &lap,
int l,
double,
int puis) {
272 return _poisson_2d_non_dege_r_chebu_quatre (lap, l) ;
274 return _poisson_2d_non_dege_r_chebu_trois (lap, l) ;
276 return _poisson_2d_non_dege_r_chebu_deux (lap, l) ;
285Matrice _poisson_2d_non_dege_r_chebu_quatre (
const Matrice &lap,
int l) {
289 const int nmax = 200;
291 static int nb_dejafait = 0 ;
292 static int l_dejafait[nmax] ;
293 static int nr_dejafait[nmax] ;
298 for (
int conte=0 ; conte<nb_dejafait ; conte ++)
299 if ((l_dejafait[conte] == l) && (nr_dejafait[conte] == n))
304 if (nb_dejafait >= nmax) {
305 cout <<
"_poisson_2d_non_dege_r_chebu : trop de matrices" << endl ;
311 l_dejafait[nb_dejafait] = l ;
312 nr_dejafait[nb_dejafait] = n ;
319 for (
int i=0 ; i<n-2 ; i++)
320 for (
int j=0 ; j<n-2 ; j++)
321 res.set(i, j) = lap(i, j+2) ;
324 tab[nb_dejafait] =
new Matrice(res) ;
331 for (
int i=0 ;i<n-3 ; i++)
332 for (
int j=0 ; j<n-3 ; j++)
333 res.set(i, j) = lap(i, j+3) ;
337 tab[nb_dejafait] =
new Matrice(res) ;
344 return *tab[indice] ;
347Matrice _poisson_2d_non_dege_r_chebu_trois (
const Matrice &lap,
int l) {
351 const int nmax = 200;
353 static int nb_dejafait = 0 ;
354 static int l_dejafait[nmax] ;
355 static int nr_dejafait[nmax] ;
360 for (
int conte=0 ; conte<nb_dejafait ; conte ++)
361 if ((l_dejafait[conte] == l) && (nr_dejafait[conte] == n))
366 if (nb_dejafait >= nmax) {
367 cout <<
"_poisson_2d_non_dege_r_chebu_trois : trop de matrices" << endl ;
372 l_dejafait[nb_dejafait] = l ;
373 nr_dejafait[nb_dejafait] = n ;
377 for (
int i=0 ; i<n-2 ; i++)
378 for (
int j=0 ; j<n-2 ; j++)
379 res.set(i, j) = lap(i, j+2) ;
382 tab[nb_dejafait] =
new Matrice(res) ;
388 return *tab[indice] ;
392Matrice _poisson_2d_non_dege_r_chebu_deux (
const Matrice &lap,
int l) {
396 const int nmax = 200;
398 static int nb_dejafait = 0 ;
399 static int l_dejafait[nmax] ;
400 static int nr_dejafait[nmax] ;
405 for (
int conte=0 ; conte<nb_dejafait ; conte ++)
406 if ((l_dejafait[conte] == l) && (nr_dejafait[conte] == n))
411 if (nb_dejafait >= nmax) {
412 cout <<
"_poisson_2d_non_dege_r_chebu : trop de matrices" << endl ;
418 l_dejafait[nb_dejafait] = l ;
419 nr_dejafait[nb_dejafait] = n ;
426 for (
int i=0 ;i<n-2 ; i++)
427 for (
int j=0 ; j<n-2 ; j++)
428 res.set(i, j) = lap(i, j+2) ;
431 tab[nb_dejafait] =
new Matrice(res) ;
438 for (
int i=0 ;i<n-1 ; i++)
439 for (
int j=0 ; j<n-1 ; j++)
440 res.set(i, j) = lap(i, j+1) ;
443 tab[nb_dejafait] =
new Matrice(res) ;
450 return *tab[indice] ;
470 poisson_2d_non_dege[i] = _poisson_2d_non_dege_pas_prevu ;
473 poisson_2d_non_dege[
R_CHEB >>
TRA_R] = _poisson_2d_non_dege_r_cheb ;
474 poisson_2d_non_dege[
R_CHEBP >>
TRA_R] = _poisson_2d_non_dege_r_chebp ;
475 poisson_2d_non_dege[
R_CHEBI >>
TRA_R] = _poisson_2d_non_dege_r_chebi ;
476 poisson_2d_non_dege[
R_CHEBU >>
TRA_R] = _poisson_2d_non_dege_r_chebu ;
int get_dim(int i) const
Returns the dimension of the matrix.
Matrice(int size1, int size2)
Standard constructor.
double beta
Parameter of the associated mapping.
double alpha
Parameter of the associated mapping.
int base_r
Radial basis of decomposition.
Matrice * ope_cl
Pointer on the banded-matrix of the operator.
Matrice * non_dege
Pointer on the non-degenerated matrix of the operator.
int dzpuis
the associated dzpuis, if in the compactified domain.
virtual void do_ope_cl() const
Computes the banded-matrix of the operator.
virtual void do_non_dege() const
Computes the non-degenerated matrix of the operator.
int l_quant
quantum number
#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