Index: mttroot/mtt/bin/trans/def2write_r ================================================================== --- mttroot/mtt/bin/trans/def2write_r +++ mttroot/mtt/bin/trans/def2write_r @@ -11,10 +11,13 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.13 2002/07/10 17:43:05 geraint +## Added feature [ 562453 ] Optimisation of algebraic equations. +## ## 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 @@ -153,11 +156,12 @@ (NF > 1) { lhs=$1 ; rhs=$2" " ; rhs1 = gensub ( /([^A-Za-z_0-9\.\+])([0-9]+)([^\.0-9])/ , "\\1\\2.0\\3" , "g", rhs ); rhs2 = gensub ( /([^e]\+)([0-9]+)([^\.0-9])/ , "\\1\\2.0\\3" , "g", rhs1 ); - printf "%s:=%s$\n", lhs, rhs2 ; + rhs3 = gensub ( /([^A-Za-z_0-9\.\+])([0-9]+)e([0-9]+).0([^\.0-9])/ , "\\1\\2\\3\\4" , "g" , rhs) + printf "%s:=%s$\n", lhs, rhs3 ; }' } mtt_optimise () {