Differences From Artifact [3fcc66207b]:

To Artifact [58e178bc16]:


9
10
11
12
13
14
15



16
17
18
19
20
21
22
# Copyright (C) 2000 by Peter J. Gawthrop

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$



## Revision 1.16.2.3  2002/09/10 23:24:19  geraint
## Rationalised local and global optimisations.
## Fixes presentation of locally optimised code (ode view).
## Much more elegant :-)
##
## Revision 1.16.2.2  2002/09/10 22:09:14  geraint
## Fixed presentation of globally optimised equations (ode view).







>
>
>







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Copyright (C) 2000 by Peter J. Gawthrop

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.17  2002/09/16 08:08:00  geraint
## Merged changes from global-optimisation branch.
##
## Revision 1.16.2.3  2002/09/10 23:24:19  geraint
## Rationalised local and global optimisations.
## Fixes presentation of locally optimised code (ode view).
## Much more elegant :-)
##
## Revision 1.16.2.2  2002/09/10 22:09:14  geraint
## Fixed presentation of globally optimised equations (ode view).
170
171
172
173
174
175
176


177
178














179
180
181
182
183
184
185
# Write out the code
echo "" > $1_$2_write.r

echo 'off echo$' >> $1_$2_write.r
echo 'load gentran$' >> $1_$2_write.r

for matrix in $matrices; do


    matrix_exists=`grep -i MTT${matrix} ${sys}_dae.r | wc -l | gawk '{print $1}'`
    if [ "$matrix" = "EdX" -o $matrix_exists -gt 0 ]; then














	n=`first "$ns"`; ns=`rest "$ns"` 
	m=`first "$ms"`; ms=`rest "$ms"`
	is=`n2m 1 $n`; 
	js=`n2m 1 $m`; 
	echo "write \"% Begin Matrix MTT${matrix}\"$" >> $1_$2_write.r
	if [ $n -ge 1 ]; then
	    for i in $is; do







>
>
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>







173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
# Write out the code
echo "" > $1_$2_write.r

echo 'off echo$' >> $1_$2_write.r
echo 'load gentran$' >> $1_$2_write.r

for matrix in $matrices; do
    ignore_matrix="no"
    if [ "$matrix" = "E" ]; then
	matrix_exists=`grep -i MTTE ${sys}_dae.r | wc -l | gawk '{print $1}'`
	if [ ! $matrix_exists -gt 0 ]; then
	    ignore_matrix="yes"
	    n=`first "$ns"`; ns=`rest "$ns"` 
	    m=`first "$ms"`; ms=`rest "$ms"`
 	    is=`n2m 1 $n`;
	    echo "write \"% Begin Matrix MTTE\"$" >> $1_$2_write.r
	    for i in $is; do
		echo 'write'
		name=`echo MTTE'('$i','$i')'`
		echo '  '$comma$name ':=' $name '$'
	    done >> $1_$2_write.r
	    echo "write \"% End Matrix MTTE\"$" >> $1_$2_write.r
	fi
    fi
    if [ ! "$ignore_matrix" = "yes" ]; then
	n=`first "$ns"`; ns=`rest "$ns"` 
	m=`first "$ms"`; ms=`rest "$ms"`
	is=`n2m 1 $n`; 
	js=`n2m 1 $m`; 
	echo "write \"% Begin Matrix MTT${matrix}\"$" >> $1_$2_write.r
	if [ $n -ge 1 ]; then
	    for i in $is; do

MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]