From 87bb301b8625ad9b75b50e8a0589112d1995280b Mon Sep 17 00:00:00 2001 From: Ian Hinder Date: Sun, 14 Feb 2010 18:42:10 +0100 Subject: CalculationFunction.m: Change the way that assignments are converted to strings --- Tools/CodeGen/CalculationFunction.m | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'Tools/CodeGen') 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]"]; -- cgit v1.2.3