11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# Copyright (c) P.J.Gawthrop 1991, 1992, 1994.
###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.22 2002/06/28 15:35:47 geraint
## Commented out aej.r generation (not used yet).
##
## Revision 1.21 2002/06/28 10:13:40 geraint
## Includes fix_c.r in ese2rdae and def2write_r to eliminate occurrances of x**y.
##
## Revision 1.20.2.1 2002/06/05 11:14:50 geraint
|
>
>
>
>
>
>
>
>
>
>
>
|
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# Copyright (c) P.J.Gawthrop 1991, 1992, 1994.
###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.23.2.2 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.23.2.1 2002/09/03 23:44:43 geraint
## adding global optimisation (-optg).
##
## Revision 1.23 2002/07/10 17:43:05 geraint
## Added feature [ 562453 ] Optimisation of algebraic equations.
##
## Revision 1.22 2002/06/28 15:35:47 geraint
## Commented out aej.r generation (not used yet).
##
## Revision 1.21 2002/06/28 10:13:40 geraint
## Includes fix_c.r in ese2rdae and def2write_r to eliminate occurrances of x**y.
##
## Revision 1.20.2.1 2002/06/05 11:14:50 geraint
|
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
|
solve=1
solve_msg=' with explicit solution of algebraic equations' ;;
-fixcc )
fixcc='-fixcc'
include=`echo 'in "'$MTT_LIB'/reduce/fix_c.r";'`
fix_msg='fixing c and cc code';
;;
-optimise)
optimise='-optimise'
optimise_msg=' with optimisation' ;;
*)
echo "$1 is an invalid argument - ignoring" ;;
esac
shift
done
# Create the reduce output code
def2write_r $optimise $fixcc $1 ae
def2write_r $optimise $fixcc $1 cse
def2write_r $optimise $fixcc $1 csex # Version without E matrix
def2write_r $optimise $fixcc $1 cseo
echo "Creating $1_ae.r $optimise_msg"
echo "Creating $1_cse.r $solve_msg $optimise_msg $fix_msg"
echo "Creating $1_csex.r $optimise_msg"
echo "Creating $1_cseo.r $optimise_msg"
# Remove the old log file
|
|
|
|
>
>
>
|
|
|
|
|
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
|
solve=1
solve_msg=' with explicit solution of algebraic equations' ;;
-fixcc )
fixcc='-fixcc'
include=`echo 'in "'$MTT_LIB'/reduce/fix_c.r";'`
fix_msg='fixing c and cc code';
;;
-optimise_global )
optimise='-optimise_global'
optimise_msg=' with global optimisation' ;;
-optimise_local )
optimise='-optimise_local'
optimise_msg=' with local optimisation' ;;
*)
echo "$1 is an invalid argument - ignoring" ;;
esac
shift
done
# Create the reduce output code
def2write_r $fixcc $1 ae
def2write_r $fixcc $1 cse
def2write_r $fixcc $1 csex # Version without E matrix
def2write_r $fixcc $1 cseo
echo "Creating $1_ae.r $optimise_msg"
echo "Creating $1_cse.r $solve_msg $optimise_msg $fix_msg"
echo "Creating $1_csex.r $optimise_msg"
echo "Creating $1_cseo.r $optimise_msg"
# Remove the old log file
|
468
469
470
471
472
473
474
475
476
477
478
479
480
481
|
touch $1_ae.r1 $1_ae.r2
touch $1_cseo.r1
touch $1_cseo.r2
cat $1_ae.r1 $1_ae.r2 > $1_ae.r
cat $1_cse.r1 $1_cse.r2 > $1_cse.r
cat $1_csex.r1 $1_csex.r2 > $1_csex.r
cat $1_cseo.r1 $1_cseo.r2 > $1_cseo.r
if [ "$solve" = "1" ]; then
echo "Setting MTTNyz=0 in $1_def.r and updating other $1_def files"
gawk '{
if ($1=="MTTNyz")
print "MTTNyz := 0;"
else print $0
|
>
>
>
>
>
>
>
>
>
>
>
>
|
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
|
touch $1_ae.r1 $1_ae.r2
touch $1_cseo.r1
touch $1_cseo.r2
cat $1_ae.r1 $1_ae.r2 > $1_ae.r
cat $1_cse.r1 $1_cse.r2 > $1_cse.r
cat $1_csex.r1 $1_csex.r2 > $1_csex.r
cat $1_cseo.r1 $1_cseo.r2 > $1_cseo.r
if [ ${optimise:-""} = "-optimise_global" ]; then
mtt_optimise global $1 ae
mtt_optimise global $1 cse
mtt_optimise global $1 cseo
mtt_optimise global $1 csex
elif [ ${optimise:-""} = "-optimise_local" ]; then
mtt_optimise local $1 ae
mtt_optimise local $1 cse
mtt_optimise local $1 cseo
mtt_optimise local $1 csex
fi
if [ "$solve" = "1" ]; then
echo "Setting MTTNyz=0 in $1_def.r and updating other $1_def files"
gawk '{
if ($1=="MTTNyz")
print "MTTNyz := 0;"
else print $0
|