00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 char comb_lin_C[] = "$Header: /cvsroot/Lorene/C++/Source/Non_class_members/PDE/comb_lin.C,v 1.8 2008/02/18 13:53:42 j_novak Exp $" ;
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107 #include <stdio.h>
00108 #include <stdlib.h>
00109 #include <math.h>
00110
00111 #include "matrice.h"
00112 #include "type_parite.h"
00113 #include "proto.h"
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130 Matrice _cl_pas_prevu (const Matrice &source, int l, double echelle, int puis) {
00131 cout << "Combinaison lineaire pas prevu..." << endl ;
00132 cout << "Source : " << source << endl ;
00133 cout << "l : " << l << endl ;
00134 cout << "dzpuis : " << puis << endl ;
00135 cout << "Echelle : " << echelle << endl ;
00136 abort() ;
00137 exit(-1) ;
00138 return source;
00139 }
00140
00141
00142
00143
00144
00145
00146 Matrice _cl_r_cheb (const Matrice &source, int l, double echelle, int) {
00147 int n = source.get_dim(0) ;assert (n == source.get_dim(1)) ;
00148
00149
00150 const int nmax = 200 ;
00151 static Matrice* tab[nmax] ;
00152 static int nb_dejafait = 0 ;
00153 static int l_dejafait[nmax] ;
00154 static int nr_dejafait[nmax] ;
00155 static double vieux_echelle = 0 ;
00156
00157
00158 if (vieux_echelle != echelle) {
00159 for (int i=0 ; i<nb_dejafait ; i++) {
00160 l_dejafait[i] = -1 ;
00161 nr_dejafait[i] = -1 ;
00162 delete tab[i] ;
00163 }
00164 nb_dejafait = 0 ;
00165 vieux_echelle = echelle ;
00166 }
00167
00168 int indice = -1 ;
00169
00170
00171 for (int conte=0 ; conte<nb_dejafait ; conte ++)
00172 if ((l_dejafait[conte] == l) && (nr_dejafait[conte] == n))
00173 indice = conte ;
00174
00175
00176 if (indice == -1) {
00177 if (nb_dejafait >= nmax) {
00178 cout << "_cl_r_cheb : trop de matrices" << endl ;
00179 abort() ;
00180 exit (-1) ;
00181 }
00182
00183 l_dejafait[nb_dejafait] = l ;
00184 nr_dejafait[nb_dejafait] = n ;
00185
00186 Matrice barre(source) ;
00187 int dirac = 1 ;
00188 for (int i=0 ; i<n-2 ; i++) {
00189 for (int j=i ; j<(n>(i+7)? i+7 : n) ; j++)
00190 barre.set(i, j) = ((1+dirac)*source(i, j)-source(i+2, j))
00191 /(i+1) ;
00192 if (i==0) dirac = 0 ;
00193 }
00194
00195 Matrice res(barre) ;
00196 for (int i=0 ; i<n-4 ; i++)
00197 for (int j=i ; j<(n>(i+5)? i+5 : n) ; j++)
00198 res.set(i, j) = barre(i, j)-barre(i+2, j) ;
00199 tab[nb_dejafait] = new Matrice(res) ;
00200 nb_dejafait ++ ;
00201 return res ;
00202 }
00203
00204
00205 else
00206 return *tab[indice] ;
00207 }
00208
00209
00210
00211
00212
00213
00214 Matrice _cl_r_jaco02 (const Matrice &source, int l, double echelle, int) {
00215 int n = source.get_dim(0) ;assert (n == source.get_dim(1)) ;
00216
00217
00218 const int nmax = 200 ;
00219 static Matrice* tab[nmax] ;
00220 static int nb_dejafait = 0 ;
00221 static int l_dejafait[nmax] ;
00222 static int nr_dejafait[nmax] ;
00223 static double vieux_echelle = 0 ;
00224
00225
00226 if (vieux_echelle != echelle) {
00227 for (int i=0 ; i<nb_dejafait ; i++) {
00228 l_dejafait[i] = -1 ;
00229 nr_dejafait[i] = -1 ;
00230 delete tab[i] ;
00231 }
00232 nb_dejafait = 0 ;
00233 vieux_echelle = echelle ;
00234 }
00235
00236 int indice = -1 ;
00237
00238
00239 for (int conte=0 ; conte<nb_dejafait ; conte ++)
00240 if ((l_dejafait[conte] == l) && (nr_dejafait[conte] == n))
00241 indice = conte ;
00242
00243
00244 if (indice == -1) {
00245 if (nb_dejafait >= nmax) {
00246 cout << "_cl_r_jaco02 : trop de matrices" << endl ;
00247 abort() ;
00248 exit (-1) ;
00249 }
00250
00251 l_dejafait[nb_dejafait] = l ;
00252 nr_dejafait[nb_dejafait] = n ;
00253
00254 Matrice barre(source) ;
00255 for (int i=0 ; i<n ; i++) {
00256 for (int j=i ; j<n ; j++)
00257 barre.set(i, j) = source(i, j) ;
00258 }
00259
00260 Matrice res(barre) ;
00261 for (int i=0 ; i<n ; i++)
00262 for (int j=i ; j<n ; j++)
00263 res.set(i, j) = barre(i, j);
00264 tab[nb_dejafait] = new Matrice(res) ;
00265 nb_dejafait ++ ;
00266 return res ;
00267 }
00268
00269
00270 else
00271 return *tab[indice] ;
00272 }
00273
00274
00275
00276
00277
00278
00279
00280 Matrice _cl_r_chebp (const Matrice &source, int l, double, int) {
00281
00282 int n = source.get_dim(0) ;
00283 assert (n == source.get_dim(1)) ;
00284
00285 const int nmax = 200 ;
00286 static Matrice* tab[nmax] ;
00287 static int nb_dejafait = 0 ;
00288 static int l_dejafait[nmax] ;
00289 static int nr_dejafait[nmax] ;
00290
00291 int indice = -1 ;
00292
00293
00294 for (int conte=0 ; conte<nb_dejafait ; conte ++)
00295 if ((l_dejafait[conte] == l) && (nr_dejafait[conte] == n))
00296 indice = conte ;
00297
00298
00299 if (indice == -1) {
00300 if (nb_dejafait >= nmax) {
00301 cout << "_cl_r_chebp : trop de matrices" << endl ;
00302 abort() ;
00303 exit (-1) ;
00304 }
00305
00306 l_dejafait[nb_dejafait] = l ;
00307 nr_dejafait[nb_dejafait] = n ;
00308
00309 Matrice barre(source) ;
00310
00311 int dirac = 1 ;
00312 for (int i=0 ; i<n-2 ; i++) {
00313 for (int j=0 ; j<n ; j++)
00314 barre.set(i, j) = (1+dirac)*source(i, j)-source(i+2, j) ;
00315 if (i==0) dirac = 0 ;
00316 }
00317
00318 Matrice tilde(barre) ;
00319 for (int i=0 ; i<n-4 ; i++)
00320 for (int j=0 ; j<n ; j++)
00321 tilde.set(i, j) = barre(i, j)-barre(i+2, j) ;
00322
00323 Matrice res(tilde) ;
00324 for (int i=0 ; i<n-4 ; i++)
00325 for (int j=0 ; j<n ; j++)
00326 res.set(i, j) = tilde(i, j)-tilde(i+1, j) ;
00327 tab[nb_dejafait] = new Matrice(res) ;
00328 nb_dejafait ++ ;
00329 return res ;
00330 }
00331
00332
00333 else
00334 return *tab[indice] ;
00335 }
00336
00337
00338
00339
00340
00341
00342 Matrice _cl_r_chebi (const Matrice &source, int l, double, int) {
00343 int n = source.get_dim(0) ;
00344 assert (n == source.get_dim(1)) ;
00345
00346
00347 const int nmax = 200 ;
00348 static Matrice* tab[nmax] ;
00349 static int nb_dejafait = 0 ;
00350 static int l_dejafait[nmax] ;
00351 static int nr_dejafait[nmax] ;
00352
00353 int indice = -1 ;
00354
00355
00356 for (int conte=0 ; conte<nb_dejafait ; conte ++)
00357 if ((l_dejafait[conte] == l) && (nr_dejafait[conte] == n))
00358 indice = conte ;
00359
00360
00361 if (indice == -1) {
00362 if (nb_dejafait >= nmax) {
00363 cout << "_cl_r_chebi : trop de matrices" << endl ;
00364 abort() ;
00365 exit (-1) ;
00366 }
00367
00368 l_dejafait[nb_dejafait] = l ;
00369 nr_dejafait[nb_dejafait] = n ;
00370
00371 Matrice barre(source) ;
00372
00373 for (int i=0 ; i<n-2 ; i++)
00374 for (int j=0 ; j<n ; j++)
00375 barre.set(i, j) = source(i, j)-source(i+2, j) ;
00376
00377 Matrice tilde(barre) ;
00378 for (int i=0 ; i<n-4 ; i++)
00379 for (int j=0 ; j<n ; j++)
00380 tilde.set(i, j) = barre(i, j)-barre(i+2, j) ;
00381
00382 Matrice res(tilde) ;
00383 for (int i=0 ; i<n-4 ; i++)
00384 for (int j=0 ; j<n ; j++)
00385 res.set(i, j) = tilde(i, j)-tilde(i+1, j) ;
00386 tab[nb_dejafait] = new Matrice(res) ;
00387 nb_dejafait ++ ;
00388 return res ;
00389 }
00390
00391
00392 else
00393 return *tab[indice] ;
00394 }
00395
00396
00397
00398
00399 Matrice _cl_r_chebu (const Matrice &source, int l, double, int puis) {
00400 int n = source.get_dim(0) ;
00401 assert (n == source.get_dim(1)) ;
00402
00403 Matrice res(n, n) ;
00404 res.set_etat_qcq() ;
00405
00406 switch (puis) {
00407 case 5 :
00408 res = _cl_r_chebu_cinq(source, l) ;
00409 break ;
00410 case 4 :
00411 res = _cl_r_chebu_quatre(source, l) ;
00412 break ;
00413 case 3 :
00414 res = _cl_r_chebu_trois (source, l) ;
00415 break ;
00416 case 2 :
00417 res = _cl_r_chebu_deux(source, l) ;
00418 break ;
00419 default :
00420 abort() ;
00421 exit(-1) ;
00422 }
00423
00424 return res ;
00425 }
00426
00427
00428
00429 Matrice _cl_r_chebu_quatre (const Matrice &source, int l) {
00430 int n = source.get_dim(0) ;
00431 assert (n == source.get_dim(1)) ;
00432
00433
00434 const int nmax = 200 ;
00435 static Matrice* tab[nmax] ;
00436 static int nb_dejafait = 0 ;
00437 static int l_dejafait[nmax] ;
00438 static int nr_dejafait[nmax] ;
00439
00440 int indice = -1 ;
00441
00442
00443 for (int conte=0 ; conte<nb_dejafait ; conte ++)
00444 if ((l_dejafait[conte] == l) && (nr_dejafait[conte] == n))
00445 indice = conte ;
00446
00447
00448 if (indice == -1) {
00449 if (nb_dejafait >= nmax) {
00450 cout << "_cl_r_chebu_quatre : trop de matrices" << endl ;
00451 abort() ;
00452 exit (-1) ;
00453 }
00454
00455 l_dejafait[nb_dejafait] = l ;
00456 nr_dejafait[nb_dejafait] = n ;
00457
00458 Matrice barre(source) ;
00459
00460 int dirac = 1 ;
00461 for (int i=0 ; i<n-2 ; i++) {
00462 for (int j=0 ; j<n ; j++)
00463 barre.set(i, j) = ((1+dirac)*source(i, j)-source(i+2, j)) ;
00464 if (i==0) dirac = 0 ;
00465 }
00466
00467 Matrice tilde(barre) ;
00468 for (int i=0 ; i<n-4 ; i++)
00469 for (int j=0 ; j<n ; j++)
00470 tilde.set(i, j) = (barre(i, j)-barre(i+2, j)) ;
00471
00472 Matrice prime(tilde) ;
00473 for (int i=0 ; i<n-4 ; i++)
00474 for (int j=0 ; j<n ; j++)
00475 prime.set(i, j) = (tilde(i, j)-tilde(i+1, j)) ;
00476
00477 Matrice res(prime) ;
00478 for (int i=0 ; i<n-4 ; i++)
00479 for (int j=0 ; j<n ; j++)
00480 res.set(i, j) = (prime(i, j)-prime(i+2, j)) ;
00481 tab[nb_dejafait] = new Matrice(res) ;
00482 nb_dejafait ++ ;
00483 return res ;
00484 }
00485
00486
00487 else
00488 return *tab[indice] ;
00489 }
00490
00491
00492 Matrice _cl_r_chebu_trois (const Matrice &source, int l) {
00493 int n = source.get_dim(0) ;
00494 assert (n == source.get_dim(1)) ;
00495
00496
00497 const int nmax = 200 ;
00498 static Matrice* tab[nmax] ;
00499 static int nb_dejafait = 0 ;
00500 static int l_dejafait[nmax] ;
00501 static int nr_dejafait[nmax] ;
00502
00503 int indice = -1 ;
00504
00505
00506 for (int conte=0 ; conte<nb_dejafait ; conte ++)
00507 if ((l_dejafait[conte] == l) && (nr_dejafait[conte] == n))
00508 indice = conte ;
00509
00510
00511 if (indice == -1) {
00512 if (nb_dejafait >= nmax) {
00513 cout << "_cl_r_chebu_trois : trop de matrices" << endl ;
00514 abort() ;
00515 exit (-1) ;
00516 }
00517
00518 l_dejafait[nb_dejafait] = l ;
00519 nr_dejafait[nb_dejafait] = n ;
00520
00521 Matrice barre(source) ;
00522
00523 int dirac = 1 ;
00524 for (int i=0 ; i<n-2 ; i++) {
00525 for (int j=0 ; j<n ; j++)
00526 barre.set(i, j) = ((1+dirac)*source(i, j)-source(i+2, j)) ;
00527 if (i==0) dirac = 0 ;
00528 }
00529
00530 Matrice tilde(barre) ;
00531 for (int i=0 ; i<n-4 ; i++)
00532 for (int j=0 ; j<n ; j++)
00533 tilde.set(i, j) = (barre(i, j)-barre(i+2, j)) ;
00534
00535 Matrice res(tilde) ;
00536 for (int i=0 ; i<n-4 ; i++)
00537 for (int j=0 ; j<n ; j++)
00538 res.set(i, j) = (tilde(i, j)+tilde(i+1, j)) ;
00539
00540 tab[nb_dejafait] = new Matrice(res) ;
00541 nb_dejafait ++ ;
00542 return res ;
00543 }
00544
00545
00546 else
00547 return *tab[indice] ;
00548 }
00549
00550
00551
00552 Matrice _cl_r_chebu_deux (const Matrice &source, int l) {
00553 int n = source.get_dim(0) ;
00554 assert (n == source.get_dim(1)) ;
00555
00556
00557 const int nmax = 200 ;
00558 static Matrice* tab[nmax] ;
00559 static int nb_dejafait = 0 ;
00560 static int l_dejafait[nmax] ;
00561 static int nr_dejafait[nmax] ;
00562
00563 int indice = -1 ;
00564
00565
00566 for (int conte=0 ; conte<nb_dejafait ; conte ++)
00567 if ((l_dejafait[conte] == l) && (nr_dejafait[conte] == n))
00568 indice = conte ;
00569
00570
00571 if (indice == -1) {
00572 if (nb_dejafait >= nmax) {
00573 cout << "_cl_r_chebu_deux : trop de matrices" << endl ;
00574 abort() ;
00575 exit (-1) ;
00576 }
00577
00578 l_dejafait[nb_dejafait] = l ;
00579 nr_dejafait[nb_dejafait] = n ;
00580
00581 Matrice barre(source) ;
00582
00583 int dirac = 1 ;
00584 for (int i=0 ; i<n-2 ; i++) {
00585 for (int j=0 ; j<n ; j++)
00586 barre.set(i, j) = ((1+dirac)*source(i, j)-source(i+2, j)) ;
00587 if (i==0) dirac = 0 ;
00588 }
00589
00590 Matrice tilde(barre) ;
00591 for (int i=0 ; i<n-4 ; i++)
00592 for (int j=0 ; j<n ; j++)
00593 tilde.set(i, j) = (barre(i, j)-barre(i+2, j)) ;
00594
00595 Matrice res(tilde) ;
00596 for (int i=0 ; i<n-4 ; i++)
00597 for (int j=0 ; j<n ; j++)
00598 res.set(i, j) = (tilde(i, j)+tilde(i+1, j)) ;
00599
00600 return res ;
00601 }
00602
00603
00604 else
00605 return *tab[indice] ;
00606 }
00607
00608
00609
00610 Matrice _cl_r_chebu_cinq (const Matrice &source, int l) {
00611 int n = source.get_dim(0) ;
00612 assert (n == source.get_dim(1)) ;
00613
00614
00615 const int nmax = 200 ;
00616 static Matrice* tab[nmax] ;
00617 static int nb_dejafait = 0 ;
00618 static int l_dejafait[nmax] ;
00619 static int nr_dejafait[nmax] ;
00620
00621 int indice = -1 ;
00622
00623
00624 for (int conte=0 ; conte<nb_dejafait ; conte ++)
00625 if ((l_dejafait[conte] == l) && (nr_dejafait[conte] == n))
00626 indice = conte ;
00627
00628
00629 if (indice == -1) {
00630 if (nb_dejafait >= nmax) {
00631 cout << "_cl_r_chebu_cinq : trop de matrices" << endl ;
00632 abort() ;
00633 exit (-1) ;
00634 }
00635
00636 l_dejafait[nb_dejafait] = l ;
00637 nr_dejafait[nb_dejafait] = n ;
00638
00639 Matrice barre(source) ;
00640
00641 int dirac = 1 ;
00642 for (int i=0 ; i<n-2 ; i++) {
00643 for (int j=0 ; j<n ; j++)
00644 barre.set(i, j) = ((1+dirac)*source(i, j)-source(i+2, j)) ;
00645 if (i==0) dirac = 0 ;
00646 }
00647
00648 Matrice tilde(barre) ;
00649 for (int i=0 ; i<n-4 ; i++)
00650 for (int j=0 ; j<n ; j++)
00651 tilde.set(i, j) = (barre(i, j)-barre(i+2, j)) ;
00652
00653 Matrice res(tilde) ;
00654 for (int i=0 ; i<n-4 ; i++)
00655 for (int j=0 ; j<n ; j++)
00656 res.set(i, j) = (tilde(i, j)+tilde(i+1, j)) ;
00657
00658
00659
00660
00661
00662 return res ;
00663 }
00664
00665
00666 else
00667 return *tab[indice] ;
00668 }
00669
00670
00671
00672
00673
00674 Matrice combinaison (const Matrice &source, int l, double echelle, int puis, int base_r) {
00675
00676
00677 static Matrice (*combinaison[MAX_BASE])(const Matrice &, int, double, int) ;
00678 static int nap = 0 ;
00679
00680
00681 if (nap==0) {
00682 nap = 1 ;
00683 for (int i=0 ; i<MAX_BASE ; i++) {
00684 combinaison[i] = _cl_pas_prevu ;
00685 }
00686
00687 combinaison[R_CHEB >> TRA_R] = _cl_r_cheb ;
00688 combinaison[R_CHEBU >> TRA_R] = _cl_r_chebu ;
00689 combinaison[R_CHEBP >> TRA_R] = _cl_r_chebp ;
00690 combinaison[R_CHEBI >> TRA_R] = _cl_r_chebi ;
00691 combinaison[R_JACO02 >> TRA_R] = _cl_r_jaco02 ;
00692 }
00693
00694 Matrice res(combinaison[base_r](source, l, echelle, puis)) ;
00695 return res ;
00696 }
00697
00698
00699
00700
00701
00702
00703 Tbl _cl_pas_prevu (const Tbl &source, int puis) {
00704 cout << "Combinaison lineaire pas prevue..." << endl ;
00705 cout << "source : " << &source << endl ;
00706 cout << "dzpuis : " << puis << endl ;
00707 abort() ;
00708 exit(-1) ;
00709 return source;
00710 }
00711
00712
00713
00714
00715
00716
00717
00718 Tbl _cl_r_cheb (const Tbl &source, int) {
00719 Tbl barre(source) ;
00720 int n = source.get_dim(0) ;
00721
00722 int dirac = 1 ;
00723 for (int i=0 ; i<n-2 ; i++) {
00724 barre.set(i) = ((1+dirac)*source(i)-source(i+2))
00725 /(i+1) ;
00726 if (i==0) dirac = 0 ;
00727 }
00728
00729 Tbl res(barre) ;
00730 for (int i=0 ; i<n-4 ; i++)
00731 res.set(i) = barre(i)-barre(i+2) ;
00732 return res ;
00733 }
00734
00735
00736
00737
00738
00739
00740 Tbl _cl_r_jaco02 (const Tbl &source, int) {
00741 Tbl barre(source) ;
00742 int n = source.get_dim(0) ;
00743
00744 for (int i=0 ; i<n ; i++) {
00745 barre.set(i) = source(i) ;
00746 }
00747
00748 Tbl res(barre) ;
00749 for (int i=0 ; i<n ; i++)
00750 res.set(i) = barre(i);
00751 return res ;
00752 }
00753
00754
00755
00756
00757
00758
00759 Tbl _cl_r_chebp (const Tbl &source, int) {
00760 Tbl barre(source) ;
00761 int n = source.get_dim(0) ;
00762
00763 int dirac = 1 ;
00764 for (int i=0 ; i<n-2 ; i++) {
00765 barre.set(i) = (1+dirac)*source(i)-source(i+2) ;
00766 if (i==0) dirac = 0 ;
00767 }
00768
00769 Tbl tilde(barre) ;
00770 for (int i=0 ; i<n-4 ; i++)
00771 tilde.set(i) = barre(i)-barre(i+2) ;
00772
00773 Tbl res(tilde) ;
00774 for (int i=0 ; i<n-4 ; i++)
00775 res.set(i) = tilde(i)-tilde(i+1) ;
00776
00777 return res ;
00778 }
00779
00780
00781
00782
00783
00784
00785 Tbl _cl_r_chebi (const Tbl &source, int) {
00786 Tbl barre(source) ;
00787 int n = source.get_dim(0) ;
00788
00789 for (int i=0 ; i<n-2 ; i++)
00790 barre.set(i) = source(i)-source(i+2) ;
00791
00792 Tbl tilde(barre) ;
00793 for (int i=0 ; i<n-4 ; i++)
00794 tilde.set(i) = barre(i)-barre(i+2) ;
00795
00796 Tbl res(tilde) ;
00797 for (int i=0 ; i<n-4 ; i++)
00798 res.set(i) = tilde(i)-tilde(i+1) ;
00799
00800 return res ;
00801 }
00802
00803
00804
00805
00806
00807
00808 Tbl _cl_r_chebu (const Tbl &source, int puis) {
00809
00810 int n=source.get_dim(0) ;
00811 Tbl res(n) ;
00812 res.set_etat_qcq() ;
00813
00814 switch(puis) {
00815 case 5 :
00816 res = _cl_r_chebu_cinq(source) ;
00817 break ;
00818 case 4 :
00819 res = _cl_r_chebu_quatre(source) ;
00820 break ;
00821 case 3 :
00822 res = _cl_r_chebu_trois (source) ;
00823 break ;
00824 case 2 :
00825 res = _cl_r_chebu_deux(source) ;
00826 break ;
00827
00828 default :
00829 abort() ;
00830 exit(-1) ;
00831 }
00832 return res ;
00833 }
00834
00835
00836 Tbl _cl_r_chebu_quatre (const Tbl &source) {
00837 Tbl barre(source) ;
00838 int n = source.get_dim(0) ;
00839
00840 int dirac = 1 ;
00841 for (int i=0 ; i<n-2 ; i++) {
00842 barre.set(i) = ((1+dirac)*source(i)-source(i+2)) ;
00843 if (i==0) dirac = 0 ;
00844 }
00845
00846 Tbl tilde(barre) ;
00847 for (int i=0 ; i<n-4 ; i++)
00848 tilde.set(i) = (barre(i)-barre(i+2)) ;
00849
00850 Tbl prime(tilde) ;
00851 for (int i=0 ; i<n-4 ; i++)
00852 prime.set(i) = (tilde(i)-tilde(i+1)) ;
00853
00854 Tbl res(prime) ;
00855 for (int i=0 ; i<n-4 ; i++)
00856 res.set(i) = (prime(i)-prime(i+2)) ;
00857
00858 return res ;
00859 }
00860
00861 Tbl _cl_r_chebu_trois (const Tbl &source) {
00862 Tbl barre(source) ;
00863 int n = source.get_dim(0) ;
00864
00865 int dirac = 1 ;
00866 for (int i=0 ; i<n-2 ; i++) {
00867 barre.set(i) = ((1+dirac)*source(i)-source(i+2)) ;
00868 if (i==0) dirac = 0 ;
00869 }
00870
00871 Tbl tilde(barre) ;
00872 for (int i=0 ; i<n-4 ; i++)
00873 tilde.set(i) = (barre(i)-barre(i+2)) ;
00874
00875 Tbl res(tilde) ;
00876 for (int i=0 ; i<n-4 ; i++)
00877 res.set(i) = (tilde(i)+tilde(i+1)) ;
00878
00879 return res ;
00880 }
00881
00882
00883 Tbl _cl_r_chebu_deux (const Tbl &source) {
00884 Tbl barre(source) ;
00885 int n = source.get_dim(0) ;
00886
00887 int dirac = 1 ;
00888 for (int i=0 ; i<n-2 ; i++) {
00889 barre.set(i) = ((1+dirac)*source(i)-source(i+2)) ;
00890 if (i==0) dirac = 0 ;
00891 }
00892
00893 Tbl tilde(barre) ;
00894 for (int i=0 ; i<n-4 ; i++)
00895 tilde.set(i) = (barre(i)-barre(i+2)) ;
00896
00897 Tbl res(tilde) ;
00898 for (int i=0 ; i<n-4 ; i++)
00899 res.set(i) = (tilde(i)+tilde(i+1)) ;
00900 return res ;
00901 }
00902
00903
00904 Tbl _cl_r_chebu_cinq (const Tbl &source) {
00905 Tbl barre(source) ;
00906 int n = source.get_dim(0) ;
00907
00908 int dirac = 1 ;
00909 for (int i=0 ; i<n-2 ; i++) {
00910 barre.set(i) = ((1+dirac)*source(i)-source(i+2)) ;
00911 if (i==0) dirac = 0 ;
00912 }
00913
00914 Tbl tilde(barre) ;
00915 for (int i=0 ; i<n-4 ; i++)
00916 tilde.set(i) = (barre(i)-barre(i+2)) ;
00917
00918 Tbl res(tilde) ;
00919 for (int i=0 ; i<n-4 ; i++)
00920 res.set(i) = (tilde(i)+tilde(i+1)) ;
00921 return res ;
00922 }
00923
00924
00925
00926
00927
00928
00929 Tbl combinaison (const Tbl &source, int puis, int base_r) {
00930
00931
00932 static Tbl (*combinaison[MAX_BASE])(const Tbl &, int) ;
00933 static int nap = 0 ;
00934
00935
00936 if (nap==0) {
00937 nap = 1 ;
00938 for (int i=0 ; i<MAX_BASE ; i++) {
00939 combinaison[i] = _cl_pas_prevu ;
00940 }
00941
00942 combinaison[R_CHEB >> TRA_R] = _cl_r_cheb ;
00943 combinaison[R_CHEBU >> TRA_R] = _cl_r_chebu ;
00944 combinaison[R_CHEBP >> TRA_R] = _cl_r_chebp ;
00945 combinaison[R_CHEBI >> TRA_R] = _cl_r_chebi ;
00946 combinaison[R_JACO02 >> TRA_R] = _cl_r_jaco02 ;
00947 }
00948
00949 Tbl res(combinaison[base_r](source, puis)) ;
00950 return res ;
00951 }