aboutsummaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authorIan Hinder <ian.hinder@aei.mpg.de>2012-02-02 01:39:54 -0600
committerIan Hinder <ian.hinder@aei.mpg.de>2012-02-02 01:39:54 -0600
commitb2cb32020d6475e0e5a9a72bc48fff6fb255faf2 (patch)
tree9213bdda09557186ba0cd4ae7020445d352341b2 /Tools
parent0342b562bad57693756aad8c1057e4eb4a52e798 (diff)
CodeGenCactus.m: Some casting - this will break vectorisation
Diffstat (limited to 'Tools')
-rw-r--r--Tools/CodeGen/CodeGenCactus.m4
1 files changed, 2 insertions, 2 deletions
diff --git a/Tools/CodeGen/CodeGenCactus.m b/Tools/CodeGen/CodeGenCactus.m
index b857a27..3624c2c 100644
--- a/Tools/CodeGen/CodeGenCactus.m
+++ b/Tools/CodeGen/CodeGenCactus.m
@@ -624,7 +624,7 @@ DefFn[
ReplacePowers[expr_, vectorise:Boolean, noSimplify:Boolean : False] :=
Module[
{rhs},
- rhs = expr /. Power[xx_, -1] -> INV[xx];
+ rhs = expr /. Power[xx_, -1] -> INV[xx] /. ToReal[x_] :> x;
If[SOURCELANGUAGE == "C",
{rhs = rhs /. Power[xx_, 2 ] -> SQR[xx];
rhs = rhs /. Power[xx_, 3 ] -> CUB[xx];
@@ -678,7 +678,7 @@ DefFn[
rhs = rhs /. ArcTan[x_, y_] -> ArcTan2[x,y];
rhs = rhs /. Power[E, power_] -> exp[power];
- rhs = rhs /. Power[xx_, power_] -> pow[xx, power];
+ rhs = rhs /. Power[xx_, power_] :> pow[xx, "(CCTK_REAL) "<>ToString[power]];
(* Note: Mathematica simplifies Max[xx_] -> xx automatically *)
rhs = rhs //. Max[xx_, yy__] -> fmax[xx, Max[yy]];
rhs = rhs //. Min[xx_, yy__] -> fmin[xx, Min[yy]];