diff options
author | Ian Hinder <ian.hinder@aei.mpg.de> | 2010-02-14 18:42:10 +0100 |
---|---|---|
committer | Ian Hinder <ian.hinder@aei.mpg.de> | 2010-03-02 08:02:22 -0600 |
commit | 87bb301b8625ad9b75b50e8a0589112d1995280b (patch) | |
tree | 5537990240d53c00f18406ba3567ed6c89d5bc84 /Tools/CodeGen/CalculationFunction.m | |
parent | b77702396436e3196a96adb0c19d3b4726952b8e (diff) |
CalculationFunction.m: Change the way that assignments are converted to strings
Diffstat (limited to 'Tools/CodeGen/CalculationFunction.m')
-rw-r--r-- | Tools/CodeGen/CalculationFunction.m | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Tools/CodeGen/CalculationFunction.m b/Tools/CodeGen/CalculationFunction.m index ee0ba6f..08678ae 100644 --- a/Tools/CodeGen/CalculationFunction.m +++ b/Tools/CodeGen/CalculationFunction.m @@ -135,8 +135,7 @@ assignVariableFromExpression[dest_, expr_] := Module[{tSym, type, cleanExpr, cod cleanExpr = ReplacePowers[expr] /. sym`t -> tSym; If[SOURCELANGUAGE == "C", - code = type <> " const " <> - ToString[dest == cleanExpr, CForm, PageWidth -> 120] <> ";\n", + code = type <> " const " <> ToString[dest] <> " = " <> ToString[cleanExpr, CForm, PageWidth -> 120] <> ";\n", code = ToString@dest <> ".eq." <> ToString[cleanExpr, FortranForm, PageWidth -> 120] <> "\n" ]; @@ -151,7 +150,7 @@ assignVariableFromExpression[dest_, expr_] := Module[{tSym, type, cleanExpr, cod ]; ]; - code = StringReplace[code, "==" -> " = "]; +(* code = StringReplace[code, "Rule" -> " = "]; *) code = StringReplace[code, "normal1" -> "normal[0]"]; code = StringReplace[code, "normal2" -> "normal[1]"]; code = StringReplace[code, "normal3" -> "normal[2]"]; |