diff options
author | Ian Hinder <ian.hinder@aei.mpg.de> | 2012-02-06 19:18:31 -0600 |
---|---|---|
committer | Ian Hinder <ian.hinder@aei.mpg.de> | 2012-02-06 19:18:31 -0600 |
commit | 79d6ce944d7b946633abddabebbe3a7cda33af17 (patch) | |
tree | 3b2fb0629b70800987c248d899b6b293159535d1 /Tools/CodeGen | |
parent | a1655d1a73a1aba5d2eb8316020536fe29c3b9b4 (diff) |
KrancScript.m: Handle numeric indices
Diffstat (limited to 'Tools/CodeGen')
-rw-r--r-- | Tools/CodeGen/KrancScript.m | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Tools/CodeGen/KrancScript.m b/Tools/CodeGen/KrancScript.m index 0163aaa..e728f14 100644 --- a/Tools/CodeGen/KrancScript.m +++ b/Tools/CodeGen/KrancScript.m @@ -121,9 +121,11 @@ process["dtensor"["indices"["lower_index"["index_symbol"["t"]]],tensor_]] := dot[process[tensor]]; process["indices"[inds___]] := Map[process, {inds}]; -process["lower_index"[i_]] := TensorIndex[process[i], "l"]; -process["upper_index"[i_]] := TensorIndex[process[i], "u"]; -process["index_symbol"[s_]] := s; + +process[(pos:("lower_index"|"upper_index"))["index_symbol"[i_]]] := + If[StringMatchQ[i,DigitCharacter], + ToExpression[i], + TensorIndex[i, If[pos==="lower_index","l","u"]]]; process["func"["name"[name_],exprs__]] := Module[ |