26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
-
+
+
|
matrix='yes';
;;
-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
shift
done
|
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
|
111
112
113
114
115
116
117
118
119
120
121
122
123
124
|
-
-
-
|
lang := $lang;
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;
% Load the general translator package
LOAD GENTRAN;
|
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
|
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
|
+
+
+
+
|
BEGIN
write "matrix mtta(", mttnx, ",", mttnx, ");";
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
GENTRAN mtta(i,j) ::=: aa_ij;
END;
|
194
195
196
197
198
199
200
201
202
203
204
205
206
207
|
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
|
+
+
|
END;
IF (mttAAx_i NEQ 0) THEN
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
fix_broken_numbers ( ) {
|