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_sx_C[] = "$Header: /cvsroot/Lorene/C++/Source/Valeur/valeur_sx.C,v 1.3 2007/12/14 10:19:35 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
00069
00070
00071
00072 #include <assert.h>
00073
00074
00075 #include "mtbl_cf.h"
00076 #include "valeur.h"
00077
00078
00079 void _sx_pas_prevu(Tbl *, int &) ;
00080 void _sx_r_chebp(Tbl *, int &) ;
00081 void _sx_r_chebi(Tbl *, int &) ;
00082 void _sx_r_chebpim_p(Tbl *, int &) ;
00083 void _sx_r_chebpim_i(Tbl *, int &) ;
00084 void _sxm1_cheb(Tbl *, int&) ;
00085 void _sx_identite (Tbl *, int &) ;
00086 void _sx_r_chebpi_p(Tbl *, int &) ;
00087 void _sx_r_chebpi_i(Tbl *, int &) ;
00088 void _sxpun_r_jaco02(Tbl *, int &) ;
00089
00090
00091
00092
00093 const Valeur& Valeur::sx() const {
00094
00095
00096 assert(etat != ETATNONDEF) ;
00097
00098
00099 if (p_sx != 0x0) {
00100 return *p_sx ;
00101 }
00102
00103
00104
00105 p_sx = new Valeur(mg) ;
00106
00107 if (etat == ETATZERO) {
00108 p_sx->set_etat_zero() ;
00109 }
00110 else {
00111 assert(etat == ETATQCQ) ;
00112 p_sx->set_etat_cf_qcq() ;
00113 Mtbl_cf* cfp = p_sx->c_cf ;
00114
00115
00116
00117 if (c_cf == 0x0) {
00118 coef() ;
00119 }
00120 *cfp = *c_cf ;
00121
00122 cfp->sx() ;
00123
00124 p_sx->base = cfp->base ;
00125 }
00126
00127
00128 return *p_sx ;
00129 }
00130
00131
00132
00133
00134
00135
00136 void Mtbl_cf::sx() {
00137
00138
00139 static void (*_sx[MAX_BASE])(Tbl *, int &) ;
00140 static int nap = 0 ;
00141
00142
00143 if (nap==0) {
00144 nap = 1 ;
00145 for (int i=0 ; i<MAX_BASE ; i++) {
00146 _sx[i] = _sx_pas_prevu ;
00147 }
00148
00149 _sx[R_CHEB >> TRA_R] = _sx_identite ;
00150 _sx[R_CHEBU >> TRA_R] = _sxm1_cheb ;
00151 _sx[R_CHEBP >> TRA_R] = _sx_r_chebp ;
00152 _sx[R_CHEBI >> TRA_R] = _sx_r_chebi ;
00153 _sx[R_CHEBPIM_P >> TRA_R] = _sx_r_chebpim_p ;
00154 _sx[R_CHEBPIM_I >> TRA_R] = _sx_r_chebpim_i ;
00155 _sx[R_CHEBPI_P >> TRA_R] = _sx_r_chebpi_p ;
00156 _sx[R_CHEBPI_I >> TRA_R] = _sx_r_chebpi_i ;
00157 _sx[R_JACO02 >> TRA_R] = _sxpun_r_jaco02 ;
00158 }
00159
00160
00161
00162
00163 assert(etat == ETATQCQ) ;
00164
00165
00166 for (int l=0 ; l<nzone ; l++) {
00167 int base_r = (base.b[l] & MSQ_R) >> TRA_R ;
00168 assert(t[l] != 0x0) ;
00169 _sx[base_r](t[l], base.b[l]) ;
00170 }
00171 }