Index: mttroot/mtt/bin/trans/cse2smx_lang ================================================================== --- mttroot/mtt/bin/trans/cse2smx_lang +++ mttroot/mtt/bin/trans/cse2smx_lang @@ -28,12 +28,13 @@ -optimise) optimise='LOAD SCOPE; ON GENTRANOPT;'; iname='INAME mtt_o;'; ;; -fixcc ) - include=`echo 'in "'$MTT_LIB'/reduce/fix_c.r";'` + fix_pow='FOR ALL x,y LET x^y = pow(x,y);' blurb2='fixing c and cc code'; + unfix_pow='FOR ALL x,y CLEAR x^y;' ;; *) echo $1 is an unknown option exit;; esac @@ -112,13 +113,10 @@ in "$1_subs.r"; in "$1_def.r"; in "$1_cse.r"; in "$1_cr.r"; -%% Fixes for c and cc (if needed) -$include; - clear mttx; % Dont need this now - use mkid instead OFF Echo; @@ -165,20 +163,24 @@ write "matrix mttb(", mttnx, ",", mttnu, ");"; write "matrix mttc(", mttny, ",", mttnx, ");"; write "matrix mttd(", mttny, ",", mttnu, ");"; END; + ${fix_pow} %% set x^y to pow(x,y) + % find MTTA : the A matrix FOR i := 1:MTTNx DO BEGIN mttAAx_i := 0; FOR j := 1:MTTNx DO BEGIN + ${unfix_pow} %% Revert to x^y form ij := i + MTTNx*(j-1); xj := mkid(mttx,j); a_ij := df(MTTEdx(i,1), xj, 1); aa_ij := MTTE(i,j) - mttt*a_ij; + ${fix_pow} %% set x^y to pow(x,y) IF (aa_ij NEQ 0) THEN IF ($nmatrix EQ 1) THEN BEGIN %% Write a with full indexing $iname @@ -196,10 +198,12 @@ IF (($nrep EQ 0) OR ($nrep EQ 2)) THEN BEGIN $iname GENTRAN mttax(i) ::=: mttAAx_i; END; + + END; %Shut the output according to the language. GENTRANSHUT "$1_$rep.body"; EOF