diff options
author | Erik Schnetter <schnetter@gmail.com> | 2011-09-28 10:31:50 +0200 |
---|---|---|
committer | Ian Hinder <ian.hinder@aei.mpg.de> | 2011-09-29 20:57:09 +0200 |
commit | 5784b9cd74b582639cb70fe91810d63f289de8ce (patch) | |
tree | f40f80e4e8f6643964e26d3659e18312af9933aa /Tools/CodeGen/CodeGen.m | |
parent | bee7aebdba5f888c0b3913767f94047bd4ea6b88 (diff) |
Add function Parenthesis
This is used to encapsulate upwind finite differencing operations in McLachlan to simplify substitutions. Similar to a parenthesis, this function does nothing.
Diffstat (limited to 'Tools/CodeGen/CodeGen.m')
-rw-r--r-- | Tools/CodeGen/CodeGen.m | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Tools/CodeGen/CodeGen.m b/Tools/CodeGen/CodeGen.m index 127ee81..6ed87d0 100644 --- a/Tools/CodeGen/CodeGen.m +++ b/Tools/CodeGen/CodeGen.m @@ -948,6 +948,9 @@ ReplacePowers[expr_, vectorise_] := rhs = rhs /. -8/3 -> -keightthird; *) + (* Remove parentheses *) + rhs = rhs //. Parenthesis[xx_] -> xx; + (* Avoid rational numbers *) rhs = rhs /. Rational[xx_,yy_] :> N[xx/yy, 30]; |