Overview
Comment: | Added feature [ 562453 ] Optimisation of algebraic equations. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | origin/master | trunk |
Files: | files | file ages | folders |
SHA3-256: |
73ae553333b382e43bc1afc201628a50 |
User & Date: | geraint@users.sourceforge.net on 2002-07-10 17:43:05 |
Other Links: | branch diff | manifest | tags |
Context
2002-07-11
| ||
13:00:23 | Declared more function arguments to be "const" - improves compiler optimisation. check-in: 7489dd518c user: geraint@users.sourceforge.net tags: origin/master, trunk | |
2002-07-10
| ||
17:43:05 | Added feature [ 562453 ] Optimisation of algebraic equations. check-in: 73ae553333 user: geraint@users.sourceforge.net tags: origin/master, trunk | |
11:53:32 | Replaced shell loop with template expansion - perceptibly quicker generation of sympar.h. check-in: f2812f12a3 user: geraint@users.sourceforge.net tags: origin/master, trunk | |
Changes
Modified mttroot/mtt/bin/trans/dae2cse_r from [fd1b6c751e] to [1e44bd3303].
︙ | |||
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | + + + + + + + | # 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 ## ae.r now generated using def2write_r like cse?.r ## fix_c.r called at ese2rdae stage so that pow gets fixed in ae.r. ## ## Revision 1.20 2002/04/28 18:41:26 geraint ## Fixed [ 549658 ] awk should be gawk. ## Replaced calls to awk with call to gawk. ## ## Revision 1.19 2001/10/26 01:01:49 geraint ## fixcc when rdae_is_dae (-cr). ## |
︙ | |||
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 | 140 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 | + + - + | *) 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 rm -f dae2cse_r.log # Remove some files |
︙ | |||
325 326 327 328 329 330 331 | 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 | - - - - - - - - - - - + + + + + + + + + + + + | set(lhs(MTT_sol_i),rhs(MTT_sol_i)); END; % No algebraic variables left! MTTNYz := 0; END; % IF MTTNyz>0 and $solve |
︙ | |||
451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 | 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 | + + | in ("$1_cseo_write.r"); write "END;"; SHUT "$1_cseo.r2"; END; quit; EOF 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 '{ |
︙ |
Modified mttroot/mtt/bin/trans/def2write_r from [24c886d294] to [de9308bd30].
︙ | |||
9 10 11 12 13 14 15 16 17 18 19 20 21 22 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | + + + + + + + | # Copyright (C) 2000 by Peter J. Gawthrop ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ ## Revision 1.12 2002/06/28 10:13:40 geraint ## Includes fix_c.r in ese2rdae and def2write_r to eliminate occurrances of x**y. ## ## Revision 1.11.2.1 2002/06/05 11:14:51 geraint ## ae.r now generated using def2write_r like cse?.r ## fix_c.r called at ese2rdae stage so that pow gets fixed in ae.r. ## ## Revision 1.11 2002/05/17 09:14:58 geraint ## Optimises each line in a separate session. Allows larger models to be built. ## ## Revision 1.10 2002/04/28 18:41:27 geraint ## Fixed [ 549658 ] awk should be gawk. ## Replaced calls to awk with call to gawk. ## |
︙ | |||
82 83 84 85 86 87 88 89 90 91 92 93 94 95 | 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | + + + + + | Nu=`mtt_getsize $sys u` # Inputs Ny=`mtt_getsize $sys y` # Outputs Nyz=`mtt_getsize $sys yz` # Zero outputs #Npar=`wc -l $sys\_sympar.txt | gawk '{print $1}'` # Set up representation-specific stuff case $rep in ae) matrices='Yz' ns="$Nyz" ms="1" ;; cse) matrices='EdX E' ns="$Nx $Nx" ms="1 $Nx" ;; csex) matrices='EdX' |
︙ | |||
180 181 182 183 184 185 186 | 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 | - + | sed -e 's/:=/:=/g' >> $tmp { cat <<EOF shut "$tmp2"$ EOF } >> $tmp |
︙ | |||
208 209 210 211 212 213 214 | 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 | + - - - - - - - - - - - - - + + + + + + + + + + + + + + | fi >> $1_$2_write.r for matrix in $matrices; do n=`first "$ns"`; ns=`rest "$ns"` m=`first "$ms"`; ms=`rest "$ms"` is=`n2m 1 $n`; js=`n2m 1 $m`; if [ $n -ge 1 ]; then |