28char cl_ptens_rr_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Ope_elementary/Ope_pois_vect_r/cl_ptens_rr.C,v 1.3 2014/10/13 08:53:34 j_novak Exp $" ;
53#include "type_parite.h"
69Matrice _cl_ptens_rr_pas_prevu (
const Matrice&,
int,
double,
int) ;
70Matrice _cl_ptens_rr_cheb (
const Matrice&,
int,
double,
int) ;
71Matrice _cl_ptens_rr_chebi (
const Matrice&,
int,
double,
int) ;
72Matrice _cl_ptens_rr_chebu (
const Matrice&,
int,
double,
int) ;
73Matrice _cl_ptens_rr_chebp (
const Matrice&,
int,
double,
int) ;
76Matrice _cl_ptens_rr_pas_prevu (
const Matrice &source,
int l,
double echelle,
int puis) {
77 cout <<
"Combinaison lineaire pas prevu..." << endl ;
78 cout <<
"Source : " << source << endl ;
79 cout <<
"l : " << l << endl ;
80 cout <<
"dzpuis : " << puis << endl ;
81 cout <<
"Echelle : " << echelle << endl ;
92Matrice _cl_ptens_rr_cheb (
const Matrice &source,
int l,
double echelle,
int) {
93 int n = source.
get_dim(0) ;assert (n == source.get_dim(1)) ;
96 const int nmax = 100 ;
97 static Matrice* tab[nmax] ;
98 static int nb_dejafait = 0 ;
99 static int l_dejafait[nmax] ;
100 static int nr_dejafait[nmax] ;
101 static double vieux_echelle = 0 ;
104 if (vieux_echelle != echelle) {
105 for (
int i=0 ; i<nb_dejafait ; i++) {
107 nr_dejafait[i] = -1 ;
111 vieux_echelle = echelle ;
117 for (
int conte=0 ; conte<nb_dejafait ; conte ++)
118 if ((l_dejafait[conte] == l) && (nr_dejafait[conte] == n))
123 if (nb_dejafait >= nmax) {
124 cout <<
"_cl_ptens_rr_cheb : trop de matrices" << endl ;
129 l_dejafait[nb_dejafait] = l ;
130 nr_dejafait[nb_dejafait] = n ;
132 Matrice barre(source) ;
134 for (
int i=0 ; i<n-2 ; i++) {
135 for (
int j=i ; j<(n>(i+7)? i+7 : n) ; j++)
136 barre.set(i, j) = ((1+dirac)*source(i, j)-source(i+2, j))
138 if (i==0) dirac = 0 ;
142 for (
int i=0 ; i<n-4 ; i++)
143 for (
int j=i ; j<(n>(i+5)? i+5 : n) ; j++)
144 res.set(i, j) = barre(i, j)-barre(i+2, j) ;
145 tab[nb_dejafait] =
new Matrice(res) ;
152 return *tab[indice] ;
160Matrice _cl_ptens_rr_chebp (
const Matrice &source,
int l,
double,
int) {
163 assert (n == source.get_dim(1)) ;
165 const int nmax = 100 ;
166 static Matrice* tab[nmax] ;
167 static int nb_dejafait = 0 ;
168 static int l_dejafait[nmax] ;
169 static int nr_dejafait[nmax] ;
174 for (
int conte=0 ; conte<nb_dejafait ; conte ++)
175 if ((l_dejafait[conte] == l) && (nr_dejafait[conte] == n))
180 if (nb_dejafait >= nmax) {
181 cout <<
"_cl_ptens_rr_chebp : trop de matrices" << endl ;
186 l_dejafait[nb_dejafait] = l ;
187 nr_dejafait[nb_dejafait] = n ;
189 Matrice barre(source) ;
192 for (
int i=0 ; i<n-2 ; i++) {
193 for (
int j=0 ; j<n ; j++)
194 barre.set(i, j) = (1+dirac)*source(i, j)-source(i+2, j) ;
195 if (i==0) dirac = 0 ;
198 Matrice tilde(barre) ;
199 for (
int i=0 ; i<n-4 ; i++)
200 for (
int j=0 ; j<n ; j++)
201 tilde.set(i, j) = barre(i, j)-barre(i+2, j) ;
204 for (
int i=0 ; i<n-4 ; i++)
205 for (
int j=0 ; j<n ; j++)
206 res.set(i, j) = tilde(i, j)-tilde(i+1, j) ;
207 tab[nb_dejafait] =
new Matrice(res) ;
214 return *tab[indice] ;
222Matrice _cl_ptens_rr_chebi (
const Matrice &source,
int l,
double,
int) {
224 assert (n == source.get_dim(1)) ;
227 const int nmax = 100 ;
228 static Matrice* tab[nmax] ;
229 static int nb_dejafait = 0 ;
230 static int l_dejafait[nmax] ;
231 static int nr_dejafait[nmax] ;
236 for (
int conte=0 ; conte<nb_dejafait ; conte ++)
237 if ((l_dejafait[conte] == l) && (nr_dejafait[conte] == n))
242 if (nb_dejafait >= nmax) {
243 cout <<
"_cl_ptens_rr_chebi : trop de matrices" << endl ;
248 l_dejafait[nb_dejafait] = l ;
249 nr_dejafait[nb_dejafait] = n ;
251 Matrice barre(source) ;
253 for (
int i=0 ; i<n-2 ; i++)
254 for (
int j=0 ; j<n ; j++)
255 barre.set(i, j) = source(i, j)-source(i+2, j) ;
257 Matrice tilde(barre) ;
258 for (
int i=0 ; i<n-4 ; i++)
259 for (
int j=0 ; j<n ; j++)
260 tilde.set(i, j) = barre(i, j)-barre(i+2, j) ;
263 for (
int i=0 ; i<n-4 ; i++)
264 for (
int j=0 ; j<n ; j++)
265 res.set(i, j) = tilde(i, j)-tilde(i+1, j) ;
266 tab[nb_dejafait] =
new Matrice(res) ;
273 return *tab[indice] ;
279Matrice _cl_ptens_rr_chebu (
const Matrice &source,
int l,
double,
int puis) {
281 assert (n == source.get_dim(1)) ;
283 cout <<
"_ope_ptens_rr_mat_r_chebu : only the case dzpuis = 4 "
284 <<
'\n' <<
"is implemented! \n"
285 <<
"dzpuis = " << puis << endl ;
289 const int nmax = 200 ;
290 static Matrice* tab[nmax] ;
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 <<
"_cl_ptens_rr_chebu_quatre : trop de matrices" << endl ;
310 l_dejafait[nb_dejafait] = l ;
311 nr_dejafait[nb_dejafait] = n ;
313 Matrice barre(source) ;
316 for (
int i=0 ; i<n-2 ; i++) {
317 for (
int j=0 ; j<n ; j++)
318 barre.set(i, j) = ((1+dirac)*source(i, j)-source(i+2, j)) ;
319 if (i==0) dirac = 0 ;
322 Matrice tilde(barre) ;
323 for (
int i=0 ; i<n-4 ; i++)
324 for (
int j=0 ; j<n ; j++)
325 tilde.set(i, j) = (barre(i, j)-barre(i+2, j)) ;
327 Matrice prime(tilde) ;
328 for (
int i=0 ; i<n-4 ; i++)
329 for (
int j=0 ; j<n ; j++)
330 prime.set(i, j) = (tilde(i, j)-tilde(i+1, j)) ;
333 for (
int i=0 ; i<n-4 ; i++)
334 for (
int j=0 ; j<n ; j++)
335 res.set(i, j) = (prime(i, j)-prime(i+2, j)) ;
336 tab[nb_dejafait] =
new Matrice(res) ;
343 return *tab[indice] ;
351Matrice cl_ptens_rr(
const Matrice &source,
int l,
double echelle,
352 int puis,
int base_r) {
355 static Matrice (*combinaison[
MAX_BASE])(
const Matrice &, int, double, int) ;
362 combinaison[i] = _cl_ptens_rr_pas_prevu ;
371 Matrice res(combinaison[base_r](source, 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