00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 char op_dsdtet_C[] = "$Header: /cvsroot/Lorene/C++/Source/Non_class_members/Operators/op_dsdtet.C,v 1.5 2009/10/08 16:22:19 j_novak Exp $" ;
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 #include "tbl.h"
00084
00085
00086
00087
00088 void _dsdtet_pas_prevu(Tbl* , int & b) {
00089 cout << "Unknown theta basis in Mtbl_cf::dsdt() !" << endl ;
00090 cout << " basis: " << hex << b << endl ;
00091 abort() ;
00092 }
00093
00094
00095
00096 void _dsdtet_t_cos(Tbl* tb, int & b)
00097 {
00098
00099
00100 if (tb->get_etat() == ETATZERO) {
00101 int base_r = b & MSQ_R ;
00102 int base_p = b & MSQ_P ;
00103 b = base_r | base_p | T_SIN ;
00104 return ;
00105 }
00106
00107
00108 assert(tb->get_etat() == ETATQCQ) ;
00109
00110
00111 int nr = (tb->dim).dim[0] ;
00112 int nt = (tb->dim).dim[1] ;
00113 int np = (tb->dim).dim[2] ;
00114 np = np - 2 ;
00115
00116
00117 static double* cx = 0 ;
00118 static int nt_pre =0 ;
00119
00120
00121
00122 {
00123 if (nt > nt_pre) {
00124 nt_pre = nt ;
00125 cx = reinterpret_cast<double*>(realloc(cx, nt * sizeof(double))) ;
00126 for (int i=0 ; i<nt ; i++) {
00127 cx[i] = - double(i) ;
00128 }
00129 }
00130 }
00131
00132
00133 double* xo = new double[(tb->dim).taille] ;
00134
00135
00136 for (int i=0; i<(tb->dim).taille; i++) {
00137 xo[i] = 0 ;
00138 }
00139
00140
00141 double* xi = tb->t ;
00142 double* xci = xi ;
00143 double* xco = xo ;
00144
00145
00146 for (int j=0 ; j<nt ; j++) {
00147 for (int i=0 ; i<nr ; i++ ) {
00148 *xco = cx[j] * (*xci) ;
00149 xci++ ;
00150 xco++ ;
00151 }
00152 }
00153
00154
00155 xci += nr*nt ;
00156 xco += nr*nt ;
00157
00158
00159 for (int k=2 ; k<np+1 ; k++) {
00160 for (int j=0 ; j<nt ; j++) {
00161 for (int i=0 ; i<nr ; i++ ) {
00162 *xco = cx[j] * (*xci) ;
00163 xci++ ;
00164 xco++ ;
00165 }
00166 }
00167 }
00168
00169
00170 delete [] tb->t ;
00171 tb->t = xo ;
00172
00173
00174 int base_r = b & MSQ_R ;
00175 int base_p = b & MSQ_P ;
00176 b = base_r | base_p | T_SIN ;
00177 }
00178
00179
00180
00181 void _dsdtet_t_sin(Tbl* tb, int & b)
00182 {
00183
00184
00185 if (tb->get_etat() == ETATZERO) {
00186 int base_r = b & MSQ_R ;
00187 int base_p = b & MSQ_P ;
00188 b = base_r | base_p | T_COS ;
00189 return ;
00190 }
00191
00192
00193 assert(tb->get_etat() == ETATQCQ) ;
00194
00195
00196 int nr = (tb->dim).dim[0] ;
00197 int nt = (tb->dim).dim[1] ;
00198 int np = (tb->dim).dim[2] ;
00199 np = np - 2 ;
00200
00201
00202 static double* cx = 0 ;
00203 static int nt_pre = 0 ;
00204
00205
00206 {
00207 if (nt > nt_pre) {
00208 nt_pre = nt ;
00209 cx = reinterpret_cast<double*>(realloc(cx, nt * sizeof(double))) ;
00210 for (int i=0 ; i<nt ; i++) {
00211 cx[i] = double(i) ;
00212 }
00213 }
00214 }
00215
00216
00217 double* xo = new double[(tb->dim).taille] ;
00218
00219
00220 for (int i=0; i<(tb->dim).taille; i++) {
00221 xo[i] = 0 ;
00222 }
00223
00224
00225 double* xi = tb->t ;
00226 double* xci = xi ;
00227 double* xco = xo ;
00228
00229
00230 for (int j=0 ; j<nt ; j++) {
00231 for (int i=0 ; i<nr ; i++ ) {
00232 *xco = cx[j] * (*xci) ;
00233 xci++ ;
00234 xco++ ;
00235 }
00236 }
00237
00238
00239 xci += nr*nt ;
00240 xco += nr*nt ;
00241
00242
00243 for (int k=2 ; k<np+1 ; k++) {
00244 for (int j=0 ; j<nt ; j++) {
00245 for (int i=0 ; i<nr ; i++ ) {
00246 *xco = cx[j] * (*xci) ;
00247 xci++ ;
00248 xco++ ;
00249 }
00250 }
00251 }
00252
00253
00254 delete [] tb->t ;
00255 tb->t = xo ;
00256
00257
00258 int base_r = b & MSQ_R ;
00259 int base_p = b & MSQ_P ;
00260 b = base_r | base_p | T_COS ;
00261 }
00262
00263
00264
00265 void _dsdtet_t_cos_p(Tbl* tb, int & b)
00266 {
00267
00268
00269 if (tb->get_etat() == ETATZERO) {
00270 int base_r = b & MSQ_R ;
00271 int base_p = b & MSQ_P ;
00272 b = base_r | base_p | T_SIN_P ;
00273 return ;
00274 }
00275
00276
00277 assert(tb->get_etat() == ETATQCQ) ;
00278
00279
00280 int nr = (tb->dim).dim[0] ;
00281 int nt = (tb->dim).dim[1] ;
00282 int np = (tb->dim).dim[2] ;
00283 np = np - 2 ;
00284
00285
00286 static double* cx = 0 ;
00287 static int nt_pre =0 ;
00288
00289
00290
00291 {
00292 if (nt > nt_pre) {
00293 nt_pre = nt ;
00294 cx = reinterpret_cast<double*>(realloc(cx, nt * sizeof(double))) ;
00295 for (int i=0 ; i<nt ; i++) {
00296 cx[i] = - (2*i) ;
00297 }
00298 }
00299 }
00300
00301
00302 double* xo = new double[(tb->dim).taille] ;
00303
00304
00305 for (int i=0; i<(tb->dim).taille; i++) {
00306 xo[i] = 0 ;
00307 }
00308
00309
00310 double* xi = tb->t ;
00311 double* xci = xi ;
00312 double* xco = xo ;
00313
00314
00315 for (int j=0 ; j<nt ; j++) {
00316 for (int i=0 ; i<nr ; i++ ) {
00317 *xco = cx[j] * (*xci) ;
00318 xci++ ;
00319 xco++ ;
00320 }
00321 }
00322
00323
00324 xci += nr*nt ;
00325 xco += nr*nt ;
00326
00327
00328 for (int k=2 ; k<np+1 ; k++) {
00329 for (int j=0 ; j<nt ; j++) {
00330 for (int i=0 ; i<nr ; i++ ) {
00331 *xco = cx[j] * (*xci) ;
00332 xci++ ;
00333 xco++ ;
00334 }
00335 }
00336 }
00337
00338
00339 delete [] tb->t ;
00340 tb->t = xo ;
00341
00342
00343 int base_r = b & MSQ_R ;
00344 int base_p = b & MSQ_P ;
00345 b = base_r | base_p | T_SIN_P ;
00346 }
00347
00348
00349
00350 void _dsdtet_t_sin_p(Tbl* tb, int & b)
00351 {
00352
00353
00354 if (tb->get_etat() == ETATZERO) {
00355 int base_r = b & MSQ_R ;
00356 int base_p = b & MSQ_P ;
00357 b = base_r | base_p | T_COS_P ;
00358 return ;
00359 }
00360
00361
00362 assert(tb->get_etat() == ETATQCQ) ;
00363
00364
00365 int nr = (tb->dim).dim[0] ;
00366 int nt = (tb->dim).dim[1] ;
00367 int np = (tb->dim).dim[2] ;
00368 np = np - 2 ;
00369
00370
00371 static double* cx = 0 ;
00372 static int nt_pre = 0 ;
00373
00374
00375 {
00376 if (nt > nt_pre) {
00377 nt_pre = nt ;
00378 cx = reinterpret_cast<double*>(realloc(cx, nt * sizeof(double))) ;
00379 for (int i=0 ; i<nt ; i++) {
00380 cx[i] = (2*i) ;
00381 }
00382 }
00383 }
00384
00385
00386 double* xo = new double[(tb->dim).taille] ;
00387
00388
00389 for (int i=0; i<(tb->dim).taille; i++) {
00390 xo[i] = 0 ;
00391 }
00392
00393
00394 double* xi = tb->t ;
00395 double* xci = xi ;
00396 double* xco = xo ;
00397
00398
00399 for (int j=0 ; j<nt ; j++) {
00400 for (int i=0 ; i<nr ; i++ ) {
00401 *xco = cx[j] * (*xci) ;
00402 xci++ ;
00403 xco++ ;
00404 }
00405 }
00406
00407
00408 xci += nr*nt ;
00409 xco += nr*nt ;
00410
00411
00412 for (int k=2 ; k<np+1 ; k++) {
00413 for (int j=0 ; j<nt ; j++) {
00414 for (int i=0 ; i<nr ; i++ ) {
00415 *xco = cx[j] * (*xci) ;
00416 xci++ ;
00417 xco++ ;
00418 }
00419 }
00420 }
00421
00422
00423 delete [] tb->t ;
00424 tb->t = xo ;
00425
00426
00427 int base_r = b & MSQ_R ;
00428 int base_p = b & MSQ_P ;
00429 b = base_r | base_p | T_COS_P ;
00430 }
00431
00432
00433
00434 void _dsdtet_t_sin_i(Tbl* tb, int & b)
00435 {
00436
00437
00438 if (tb->get_etat() == ETATZERO) {
00439 int base_r = b & MSQ_R ;
00440 int base_p = b & MSQ_P ;
00441 b = base_r | base_p | T_COS_I ;
00442 return ;
00443 }
00444
00445
00446 assert(tb->get_etat() == ETATQCQ) ;
00447
00448
00449 int nr = (tb->dim).dim[0] ;
00450 int nt = (tb->dim).dim[1] ;
00451 int np = (tb->dim).dim[2] ;
00452 np = np - 2 ;
00453
00454
00455 static double* cx = 0 ;
00456 static int nt_pre =0 ;
00457
00458
00459
00460 {
00461 if (nt > nt_pre) {
00462 nt_pre = nt ;
00463 cx = reinterpret_cast<double*>(realloc(cx, nt * sizeof(double))) ;
00464 for (int i=0 ; i<nt ; i++) {
00465 cx[i] = (2*i+1) ;
00466 }
00467 }
00468 }
00469
00470
00471 double* xo = new double[(tb->dim).taille] ;
00472
00473
00474 for (int i=0; i<(tb->dim).taille; i++) {
00475 xo[i] = 0 ;
00476 }
00477
00478
00479 double* xi = tb->t ;
00480 double* xci = xi ;
00481 double* xco = xo ;
00482
00483
00484 for (int j=0 ; j<nt ; j++) {
00485 for (int i=0 ; i<nr ; i++ ) {
00486 *xco = cx[j] * (*xci) ;
00487 xci++ ;
00488 xco++ ;
00489 }
00490 }
00491
00492
00493 xci += nr*nt ;
00494 xco += nr*nt ;
00495
00496
00497 for (int k=2 ; k<np+1 ; k++) {
00498 for (int j=0 ; j<nt ; j++) {
00499 for (int i=0 ; i<nr ; i++ ) {
00500 *xco = cx[j] * (*xci) ;
00501 xci++ ;
00502 xco++ ;
00503 }
00504 }
00505 }
00506
00507
00508 delete [] tb->t ;
00509 tb->t = xo ;
00510
00511
00512 int base_r = b & MSQ_R ;
00513 int base_p = b & MSQ_P ;
00514 b = base_r | base_p | T_COS_I ;
00515 }
00516
00517
00518
00519 void _dsdtet_t_cos_i(Tbl* tb, int & b)
00520 {
00521
00522
00523 if (tb->get_etat() == ETATZERO) {
00524 int base_r = b & MSQ_R ;
00525 int base_p = b & MSQ_P ;
00526 b = base_r | base_p | T_SIN_I ;
00527 return ;
00528 }
00529
00530
00531 assert(tb->get_etat() == ETATQCQ) ;
00532
00533
00534 int nr = (tb->dim).dim[0] ;
00535 int nt = (tb->dim).dim[1] ;
00536 int np = (tb->dim).dim[2] ;
00537 np = np - 2 ;
00538
00539
00540 static double* cx = 0 ;
00541 static int nt_pre =0 ;
00542
00543
00544
00545 {
00546 if (nt > nt_pre) {
00547 nt_pre = nt ;
00548 cx = reinterpret_cast<double*>(realloc(cx, nt * sizeof(double))) ;
00549 for (int i=0 ; i<nt ; i++) {
00550 cx[i] = - (2*i+1) ;
00551 }
00552 }
00553 }
00554
00555
00556 double* xo = new double[(tb->dim).taille] ;
00557
00558
00559 for (int i=0; i<(tb->dim).taille; i++) {
00560 xo[i] = 0 ;
00561 }
00562
00563
00564 double* xi = tb->t ;
00565 double* xci = xi ;
00566 double* xco = xo ;
00567
00568
00569 for (int j=0 ; j<nt ; j++) {
00570 for (int i=0 ; i<nr ; i++ ) {
00571 *xco = cx[j] * (*xci) ;
00572 xci++ ;
00573 xco++ ;
00574 }
00575 }
00576
00577
00578 xci += nr*nt ;
00579 xco += nr*nt ;
00580
00581
00582 for (int k=2 ; k<np+1 ; k++) {
00583 for (int j=0 ; j<nt ; j++) {
00584 for (int i=0 ; i<nr ; i++ ) {
00585 *xco = cx[j] * (*xci) ;
00586 xci++ ;
00587 xco++ ;
00588 }
00589 }
00590 }
00591
00592
00593 delete [] tb->t ;
00594 tb->t = xo ;
00595
00596
00597 int base_r = b & MSQ_R ;
00598 int base_p = b & MSQ_P ;
00599 b = base_r | base_p | T_SIN_I ;
00600 }
00601
00602
00603
00604 void _dsdtet_t_cossin_cp(Tbl* tb, int & b)
00605 {
00606
00607
00608 if (tb->get_etat() == ETATZERO) {
00609 int base_r = b & MSQ_R ;
00610 int base_p = b & MSQ_P ;
00611 b = base_r | base_p | T_COSSIN_SP ;
00612 return ;
00613 }
00614
00615
00616 assert(tb->get_etat() == ETATQCQ) ;
00617
00618
00619 int nr = (tb->dim).dim[0] ;
00620 int nt = (tb->dim).dim[1] ;
00621 int np = (tb->dim).dim[2] ;
00622 np = np - 2 ;
00623
00624
00625 static double* cxp = 0 ;
00626 static double* cxi = 0 ;
00627 static int nt_pre = 0 ;
00628
00629
00630
00631 {
00632 if (nt > nt_pre) {
00633 nt_pre = nt ;
00634 cxp = reinterpret_cast<double*>(realloc(cxp, nt * sizeof(double))) ;
00635 cxi = reinterpret_cast<double*>(realloc(cxi, nt * sizeof(double))) ;
00636 for (int i=0 ; i<nt ; i++) {
00637 cxp[i] = - (2*i) ;
00638 cxi[i] = (2*i+1) ;
00639 }
00640 }
00641 }
00642
00643
00644 double* xo = new double[(tb->dim).taille] ;
00645
00646
00647 for (int i=0; i<(tb->dim).taille; i++) {
00648 xo[i] = 0 ;
00649 }
00650
00651
00652 double* xi = tb->t ;
00653 double* xci = xi ;
00654 double* xco = xo ;
00655 double* cx[2] ;
00656
00657
00658 cx[0] = cxp ;
00659 cx[1] = cxi ;
00660
00661
00662
00663 double* cxl = cx[0] ;
00664 for (int j=0 ; j<nt ; j++) {
00665 for (int i=0 ; i<nr ; i++) {
00666 *xco = cxl[j] * (*xci) ;
00667 xci++ ;
00668 xco++ ;
00669 }
00670 }
00671
00672
00673 xci += nr*nt ;
00674 xco += nr*nt ;
00675
00676
00677 for (int k=2 ; k<np+1 ; k++) {
00678
00679 int m = (k/2) % 2 ;
00680 cxl = cx[m] ;
00681 for (int j=0 ; j<nt ; j++) {
00682 for (int i=0 ; i<nr ; i++) {
00683 *xco = cxl[j] * (*xci) ;
00684 xci++ ;
00685 xco++ ;
00686 }
00687 }
00688 }
00689
00690
00691 delete [] tb->t ;
00692 tb->t = xo ;
00693
00694
00695 int base_r = b & MSQ_R ;
00696 int base_p = b & MSQ_P ;
00697 b = base_r | base_p | T_COSSIN_SP ;
00698 }
00699
00700
00701
00702 void _dsdtet_t_cossin_sp(Tbl* tb, int & b)
00703 {
00704
00705
00706 if (tb->get_etat() == ETATZERO) {
00707 int base_r = b & MSQ_R ;
00708 int base_p = b & MSQ_P ;
00709 b = base_r | base_p | T_COSSIN_CP ;
00710 return ;
00711 }
00712
00713
00714 assert(tb->get_etat() == ETATQCQ) ;
00715
00716
00717 int nr = (tb->dim).dim[0] ;
00718 int nt = (tb->dim).dim[1] ;
00719 int np = (tb->dim).dim[2] ;
00720 np = np - 2 ;
00721
00722
00723 static double* cxp = 0 ;
00724 static double* cxi = 0 ;
00725 static int nt_pre =0 ;
00726
00727
00728
00729 {
00730 if (nt > nt_pre) {
00731 nt_pre = nt ;
00732 cxp = reinterpret_cast<double*>(realloc(cxp, nt * sizeof(double))) ;
00733 cxi = reinterpret_cast<double*>(realloc(cxi, nt * sizeof(double))) ;
00734 for (int i=0 ; i<nt ; i++) {
00735 cxp[i] = (2*i) ;
00736 cxi[i] = - (2*i+1) ;
00737 }
00738 }
00739 }
00740
00741
00742 double* xo = new double[(tb->dim).taille] ;
00743
00744
00745 for (int i=0; i<(tb->dim).taille; i++) {
00746 xo[i] = 0 ;
00747 }
00748
00749
00750 double* xi = tb->t ;
00751 double* xci = xi ;
00752 double* xco = xo ;
00753 double* cx[2] ;
00754
00755
00756 cx[0] = cxp ;
00757 cx[1] = cxi ;
00758
00759
00760
00761 double* cxl = cx[0] ;
00762 for (int j=0 ; j<nt ; j++) {
00763 for (int i=0 ; i<nr ; i++) {
00764 *xco = cxl[j] * (*xci) ;
00765 xci++ ;
00766 xco++ ;
00767 }
00768 }
00769
00770
00771 xci += nr*nt ;
00772 xco += nr*nt ;
00773
00774
00775 for (int k=2 ; k<np+1 ; k++) {
00776
00777 int m = (k/2) % 2 ;
00778 cxl = cx[m] ;
00779 for (int j=0 ; j<nt ; j++) {
00780 for (int i=0 ; i<nr ; i++) {
00781 *xco = cxl[j] * (*xci) ;
00782 xci++ ;
00783 xco++ ;
00784 }
00785 }
00786 }
00787
00788
00789 delete [] tb->t ;
00790 tb->t = xo ;
00791
00792
00793 int base_r = b & MSQ_R ;
00794 int base_p = b & MSQ_P ;
00795 b = base_r | base_p | T_COSSIN_CP ;
00796 }
00797
00798
00799
00800 void _dsdtet_t_cossin_ci(Tbl* tb, int & b)
00801 {
00802
00803
00804 if (tb->get_etat() == ETATZERO) {
00805 int base_r = b & MSQ_R ;
00806 int base_p = b & MSQ_P ;
00807 b = base_r | base_p | T_COSSIN_SI ;
00808 return ;
00809 }
00810
00811
00812 assert(tb->get_etat() == ETATQCQ) ;
00813
00814
00815 int nr = (tb->dim).dim[0] ;
00816 int nt = (tb->dim).dim[1] ;
00817 int np = (tb->dim).dim[2] ;
00818 np = np - 2 ;
00819
00820
00821 static double* cxp = 0 ;
00822 static double* cxi = 0 ;
00823 static int nt_pre =0 ;
00824
00825
00826
00827 {
00828 if (nt > nt_pre) {
00829 nt_pre = nt ;
00830 cxp = reinterpret_cast<double*>(realloc(cxp, nt * sizeof(double))) ;
00831 cxi = reinterpret_cast<double*>(realloc(cxi, nt * sizeof(double))) ;
00832 for (int i=0 ; i<nt ; i++) {
00833 cxp[i] = (2*i) ;
00834 cxi[i] = - (2*i+1) ;
00835 }
00836 }
00837 }
00838
00839
00840 double* xo = new double[(tb->dim).taille] ;
00841
00842
00843 for (int i=0; i<(tb->dim).taille; i++) {
00844 xo[i] = 0 ;
00845 }
00846
00847
00848 double* xi = tb->t ;
00849 double* xci = xi ;
00850 double* xco = xo ;
00851 double* cx[2] ;
00852
00853
00854 cx[0] = cxi ;
00855 cx[1] = cxp ;
00856
00857
00858
00859 double* cxl = cx[0] ;
00860 for (int j=0 ; j<nt ; j++) {
00861 for (int i=0 ; i<nr ; i++) {
00862 *xco = cxl[j] * (*xci) ;
00863 xci++ ;
00864 xco++ ;
00865 }
00866 }
00867
00868
00869 xci += nr*nt ;
00870 xco += nr*nt ;
00871
00872
00873 for (int k=2 ; k<np+1 ; k++) {
00874
00875 int m = (k/2) % 2 ;
00876 cxl = cx[m] ;
00877 for (int j=0 ; j<nt ; j++) {
00878 for (int i=0 ; i<nr ; i++) {
00879 *xco = cxl[j] * (*xci) ;
00880 xci++ ;
00881 xco++ ;
00882 }
00883 }
00884 }
00885
00886
00887 delete [] tb->t ;
00888 tb->t = xo ;
00889
00890
00891 int base_r = b & MSQ_R ;
00892 int base_p = b & MSQ_P ;
00893 b = base_r | base_p | T_COSSIN_SI ;
00894 }
00895
00896
00897
00898 void _dsdtet_t_cossin_si(Tbl* tb, int & b)
00899 {
00900
00901
00902 if (tb->get_etat() == ETATZERO) {
00903 int base_r = b & MSQ_R ;
00904 int base_p = b & MSQ_P ;
00905 b = base_r | base_p | T_COSSIN_CI ;
00906 return ;
00907 }
00908
00909
00910 assert(tb->get_etat() == ETATQCQ) ;
00911
00912
00913 int nr = (tb->dim).dim[0] ;
00914 int nt = (tb->dim).dim[1] ;
00915 int np = (tb->dim).dim[2] ;
00916 np = np - 2 ;
00917
00918
00919 static double* cxp = 0 ;
00920 static double* cxi = 0 ;
00921 static int nt_pre =0 ;
00922
00923
00924
00925 {
00926 if (nt > nt_pre) {
00927 nt_pre = nt ;
00928 cxp = reinterpret_cast<double*>(realloc(cxp, nt * sizeof(double))) ;
00929 cxi = reinterpret_cast<double*>(realloc(cxi, nt * sizeof(double))) ;
00930 for (int i=0 ; i<nt ; i++) {
00931 cxp[i] = - (2*i) ;
00932 cxi[i] = (2*i+1) ;
00933 }
00934 }
00935 }
00936
00937
00938 double* xo = new double[(tb->dim).taille] ;
00939
00940
00941 for (int i=0; i<(tb->dim).taille; i++) {
00942 xo[i] = 0 ;
00943 }
00944
00945
00946 double* xi = tb->t ;
00947 double* xci = xi ;
00948 double* xco = xo ;
00949 double* cx[2] ;
00950
00951
00952 cx[0] = cxi ;
00953 cx[1] = cxp ;
00954
00955
00956
00957 double* cxl = cx[0] ;
00958 for (int j=0 ; j<nt ; j++) {
00959 for (int i=0 ; i<nr ; i++) {
00960 *xco = cxl[j] * (*xci) ;
00961 xci++ ;
00962 xco++ ;
00963 }
00964 }
00965
00966
00967 xci += nr*nt ;
00968 xco += nr*nt ;
00969
00970
00971 for (int k=2 ; k<np+1 ; k++) {
00972
00973 int m = (k/2) % 2 ;
00974 cxl = cx[m] ;
00975 for (int j=0 ; j<nt ; j++) {
00976 for (int i=0 ; i<nr ; i++) {
00977 *xco = cxl[j] * (*xci) ;
00978 xci++ ;
00979 xco++ ;
00980 }
00981 }
00982 }
00983
00984
00985 delete [] tb->t ;
00986 tb->t = xo ;
00987
00988
00989 int base_r = b & MSQ_R ;
00990 int base_p = b & MSQ_P ;
00991 b = base_r | base_p | T_COSSIN_CI ;
00992 }
00993
00994
00995
00996 void _dsdtet_t_cossin_c(Tbl* tb, int & b)
00997 {
00998
00999
01000 if (tb->get_etat() == ETATZERO) {
01001 int base_r = b & MSQ_R ;
01002 int base_p = b & MSQ_P ;
01003 b = base_r | base_p | T_COSSIN_S ;
01004 return ;
01005 }
01006
01007
01008 assert(tb->get_etat() == ETATQCQ) ;
01009
01010
01011 int nr = (tb->dim).dim[0] ;
01012 int nt = (tb->dim).dim[1] ;
01013 int np = (tb->dim).dim[2] ;
01014 np = np - 2 ;
01015
01016
01017 static double* cxp = 0 ;
01018 static double* cxi = 0 ;
01019 static int nt_pre = 0 ;
01020
01021
01022
01023 {
01024 if (nt > nt_pre) {
01025 nt_pre = nt ;
01026 cxp = reinterpret_cast<double*>(realloc(cxp, nt * sizeof(double))) ;
01027 cxi = reinterpret_cast<double*>(realloc(cxi, nt * sizeof(double))) ;
01028 for (int i=0 ; i<nt ; i++) {
01029 cxp[i] = - i ;
01030 cxi[i] = i ;
01031 }
01032 }
01033 }
01034
01035
01036 double* xo = new double[(tb->dim).taille] ;
01037
01038
01039 for (int i=0; i<(tb->dim).taille; i++) {
01040 xo[i] = 0 ;
01041 }
01042
01043
01044 double* xi = tb->t ;
01045 double* xci = xi ;
01046 double* xco = xo ;
01047 double* cx[2] ;
01048
01049
01050 cx[0] = cxp ;
01051 cx[1] = cxi ;
01052
01053
01054
01055 double* cxl = cx[0] ;
01056 for (int j=0 ; j<nt ; j++) {
01057 for (int i=0 ; i<nr ; i++) {
01058 *xco = cxl[j] * (*xci) ;
01059 xci++ ;
01060 xco++ ;
01061 }
01062 }
01063
01064
01065 xci += nr*nt ;
01066 xco += nr*nt ;
01067
01068
01069 for (int k=2 ; k<np+1 ; k++) {
01070
01071 int m = (k/2) % 2 ;
01072 cxl = cx[m] ;
01073 for (int j=0 ; j<nt ; j++) {
01074 for (int i=0 ; i<nr ; i++) {
01075 *xco = cxl[j] * (*xci) ;
01076 xci++ ;
01077 xco++ ;
01078 }
01079 }
01080 }
01081
01082
01083 delete [] tb->t ;
01084 tb->t = xo ;
01085
01086
01087 int base_r = b & MSQ_R ;
01088 int base_p = b & MSQ_P ;
01089 b = base_r | base_p | T_COSSIN_S ;
01090 }
01091
01092
01093
01094 void _dsdtet_t_cossin_s(Tbl* tb, int & b)
01095 {
01096
01097
01098 if (tb->get_etat() == ETATZERO) {
01099 int base_r = b & MSQ_R ;
01100 int base_p = b & MSQ_P ;
01101 b = base_r | base_p | T_COSSIN_C ;
01102 return ;
01103 }
01104
01105
01106 assert(tb->get_etat() == ETATQCQ) ;
01107
01108
01109 int nr = (tb->dim).dim[0] ;
01110 int nt = (tb->dim).dim[1] ;
01111 int np = (tb->dim).dim[2] ;
01112 np = np - 2 ;
01113
01114
01115 static double* cxp = 0 ;
01116 static double* cxi = 0 ;
01117 static int nt_pre =0 ;
01118
01119
01120
01121 {
01122 if (nt > nt_pre) {
01123 nt_pre = nt ;
01124 cxp = reinterpret_cast<double*>(realloc(cxp, nt * sizeof(double))) ;
01125 cxi = reinterpret_cast<double*>(realloc(cxi, nt * sizeof(double))) ;
01126 for (int i=0 ; i<nt ; i++) {
01127 cxp[i] = i ;
01128 cxi[i] = - i ;
01129 }
01130 }
01131 }
01132
01133
01134 double* xo = new double[(tb->dim).taille] ;
01135
01136
01137 for (int i=0; i<(tb->dim).taille; i++) {
01138 xo[i] = 0 ;
01139 }
01140
01141
01142 double* xi = tb->t ;
01143 double* xci = xi ;
01144 double* xco = xo ;
01145 double* cx[2] ;
01146
01147
01148 cx[0] = cxp ;
01149 cx[1] = cxi ;
01150
01151
01152
01153 double* cxl = cx[0] ;
01154 for (int j=0 ; j<nt ; j++) {
01155 for (int i=0 ; i<nr ; i++) {
01156 *xco = cxl[j] * (*xci) ;
01157 xci++ ;
01158 xco++ ;
01159 }
01160 }
01161
01162
01163 xci += nr*nt ;
01164 xco += nr*nt ;
01165
01166
01167 for (int k=2 ; k<np+1 ; k++) {
01168
01169 int m = (k/2) % 2 ;
01170 cxl = cx[m] ;
01171 for (int j=0 ; j<nt ; j++) {
01172 for (int i=0 ; i<nr ; i++) {
01173 *xco = cxl[j] * (*xci) ;
01174 xci++ ;
01175 xco++ ;
01176 }
01177 }
01178 }
01179
01180
01181 delete [] tb->t ;
01182 tb->t = xo ;
01183
01184
01185 int base_r = b & MSQ_R ;
01186 int base_p = b & MSQ_P ;
01187 b = base_r | base_p | T_COSSIN_C ;
01188 }