Skip to content

Commit

Permalink
do not strip i1 and i2 from symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Voigt authored and Alexander Voigt committed Jul 26, 2016
1 parent ce3aa99 commit d0ba7e9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 24 deletions.
4 changes: 0 additions & 4 deletions meta/CConversion.m
Expand Up @@ -615,10 +615,6 @@

ToValidCSymbol[symbol_Real] := symbol;

ToValidCSymbol[symbol_[Susyno`LieGroups`i1]] := ToValidCSymbol[symbol];

ToValidCSymbol[symbol_[Susyno`LieGroups`i1,SARAH`i2]] := ToValidCSymbol[symbol];

ToValidCSymbol[symbol_ /; Length[symbol] > 0] :=
Module[{result = "", i},
For[i = 0, i <= Length[symbol], i++,
Expand Down
20 changes: 0 additions & 20 deletions test/test_CConversion.m
Expand Up @@ -20,12 +20,6 @@
TestEquality[ToValidCSymbol[a[b,c]], abc];
TestEquality[ToValidCSymbol[a[b,c][d]], abcd];

(* SARAH sometimes appends indices [i1,i2] to express that a symbol is
of type matrix. These indices should be stripped before
conversion. *)
TestEquality[ToValidCSymbol[a[Susyno`LieGroups`i1,SARAH`i2]], a];
TestEquality[ToValidCSymbol[a[b,c][Susyno`LieGroups`i1,SARAH`i2]], abc];

(* Test that symbols, which consist of greek letters are correctly
converted. *)
TestEquality[ToValidCSymbol[\[Lambda]3], Lambda3];
Expand All @@ -43,13 +37,6 @@
TestEquality[ToValidCSymbolString[a[b,c]], "abc"];
TestEquality[ToValidCSymbolString[a[b,c][d]], "abcd"];

(* SARAH sometimes appends indices [i1,i2] to express that a type is
of type matrix. These indices should be stripped before
conversion. *)
TestEquality[ToValidCSymbolString[a[Susyno`LieGroups`i1,SARAH`i2]], "a"];
TestEquality[ToValidCSymbolString[a[b][Susyno`LieGroups`i1,SARAH`i2]], "ab"];
TestEquality[ToValidCSymbolString[a[b,c][Susyno`LieGroups`i1,SARAH`i2]], "abc"];

Print["testing RValueToCFormString[] ..."];

TestEquality[RValueToCFormString[1], "1"];
Expand All @@ -70,13 +57,6 @@
TestEquality[RValueToCFormString[trace[Adj[A]]], "(A.adjoint()).trace()"];
TestEquality[RValueToCFormString[trace[A Adj[A]]], "(A*A.adjoint()).trace()"];

(* SARAH sometimes appends indices [i1,i2] to express that a type is
of type matrix. These indices should be stripped before
conversion. *)
TestEquality[RValueToCFormString[a[Susyno`LieGroups`i1,SARAH`i2]], "a"];
TestEquality[RValueToCFormString[a[b][Susyno`LieGroups`i1,SARAH`i2]], "a(b)"];
TestEquality[RValueToCFormString[a[b,c][Susyno`LieGroups`i1,SARAH`i2]], "a(b,c)"];

(* test greek symbol conversion *)
TestEquality[RValueToCFormString[\[Mu]], "Mu"];
TestEquality[RValueToCFormString[SARAH`B[\[Mu]]], "BMu"];
Expand Down

0 comments on commit d0ba7e9

Please sign in to comment.