aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshusa <shusa>2005-11-15 13:39:39 +0000
committershusa <shusa>2005-11-15 13:39:39 +0000
commita3f3f2eabf428791c59cdaaa5b373f74cc94b755 (patch)
treef62afff42bdf716dc3d5ba9ba21b315f234567c9
parent3f94d792cb0734819b06af06076299826941a841 (diff)
do not use SQR, CUB, QAD macros for Fortran anymore, since they are not
necessary, and apparently confuse some preprocessors under certain circumstances.
-rw-r--r--Tools/CodeGen/CodeGen.m9
1 files changed, 5 insertions, 4 deletions
diff --git a/Tools/CodeGen/CodeGen.m b/Tools/CodeGen/CodeGen.m
index 817eb5e..7c8a49d 100644
--- a/Tools/CodeGen/CodeGen.m
+++ b/Tools/CodeGen/CodeGen.m
@@ -503,13 +503,14 @@ insertFile[name_] :=
macros SQR, CUB, QAD *)
ReplacePowers[x_] :=
Module[{rhs},
- rhs = x /. Power[xx_, 2] -> SQR[xx];
- rhs = rhs /. Power[xx_, 3] -> CUB[xx];
- rhs = rhs /. Power[xx_, 4] -> QAD[xx];
- rhs = rhs /. Power[xx_, -1] -> INV[xx];
+ rhs = x /. Power[xx_, -1] -> INV[xx];
If[SOURCELANGUAGE == "C",
Module[{},
+ rhs = rhs /. Power[xx_, 2] -> SQR[xx];
+ rhs = rhs /. Power[xx_, 3] -> CUB[xx];
+ rhs = rhs /. Power[xx_, 4] -> QAD[xx];
+
rhs = rhs /. Power[E, power_] -> exp[power];
rhs = rhs /. Power[xx_, 0.5] -> sqrt[xx];