00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 char valeur_mult_x_C[] = "$Header: /cvsroot/Lorene/C++/Source/Valeur/valeur_mult_x.C,v 1.3 2008/08/27 08:52:55 jl_cornou Exp $" ;
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 #include <assert.h>
00069
00070
00071 #include "mtbl_cf.h"
00072 #include "valeur.h"
00073
00074
00075 void _mult_x_pas_prevu(Tbl *, int &) ;
00076 void _mult_x_r_chebp(Tbl *, int &) ;
00077 void _mult_x_r_chebi(Tbl *, int &) ;
00078 void _mult_x_r_chebpim_p(Tbl *, int &) ;
00079 void _mult_x_r_chebpim_i(Tbl *, int &) ;
00080 void _mult_xm1_cheb(Tbl *, int&) ;
00081 void _mult_x_identite (Tbl *, int &) ;
00082 void _mult_x_r_chebpi_p(Tbl *, int &) ;
00083 void _mult_x_r_chebpi_i(Tbl *, int &) ;
00084 void _mult_x_r_jaco02(Tbl *, int &) ;
00085
00086
00087
00088
00089 const Valeur& Valeur::mult_x() const {
00090
00091
00092 assert(etat != ETATNONDEF) ;
00093
00094
00095 if (p_mult_x != 0x0) {
00096 return *p_mult_x ;
00097 }
00098
00099
00100
00101 p_mult_x = new Valeur(mg) ;
00102
00103 if (etat == ETATZERO) {
00104 p_mult_x->set_etat_zero() ;
00105 }
00106 else {
00107 assert(etat == ETATQCQ) ;
00108 p_mult_x->set_etat_cf_qcq() ;
00109 Mtbl_cf* cfp = p_mult_x->c_cf ;
00110
00111
00112
00113 if (c_cf == 0x0) {
00114 coef() ;
00115 }
00116 *cfp = *c_cf ;
00117
00118 cfp->mult_x() ;
00119
00120 p_mult_x->base = cfp->base ;
00121 }
00122
00123
00124 return *p_mult_x ;
00125 }
00126
00127
00128
00129
00130
00131
00132 void Mtbl_cf::mult_x() {
00133
00134
00135 static void (*_mult_x[MAX_BASE])(Tbl *, int &) ;
00136 static int nap = 0 ;
00137
00138
00139 if (nap==0) {
00140 nap = 1 ;
00141 for (int i=0 ; i<MAX_BASE ; i++) {
00142 _mult_x[i] = _mult_x_pas_prevu ;
00143 }
00144
00145 _mult_x[R_CHEB >> TRA_R] = _mult_x_identite ;
00146 _mult_x[R_CHEBU >> TRA_R] = _mult_xm1_cheb ;
00147 _mult_x[R_CHEBP >> TRA_R] = _mult_x_r_chebp ;
00148 _mult_x[R_CHEBI >> TRA_R] = _mult_x_r_chebi ;
00149 _mult_x[R_CHEBPIM_P >> TRA_R] = _mult_x_r_chebpim_p ;
00150 _mult_x[R_CHEBPIM_I >> TRA_R] = _mult_x_r_chebpim_i ;
00151 _mult_x[R_CHEBPI_P >> TRA_R] = _mult_x_r_chebpi_p ;
00152 _mult_x[R_CHEBPI_I >> TRA_R] = _mult_x_r_chebpi_i ;
00153 _mult_x[R_JACO02 >> TRA_R] = _mult_x_r_jaco02 ;
00154 }
00155
00156
00157
00158
00159 assert(etat == ETATQCQ) ;
00160
00161
00162 int base_r ;
00163 for (int l=0 ; l<nzone ; l++) {
00164 base_r = (base.b[l] & MSQ_R) >> TRA_R ;
00165 assert(t[l] != 0x0) ;
00166 _mult_x[base_r](t[l], base.b[l]) ;
00167 }
00168 }