Skip to content

Commit

Permalink
Don't allow indices to be used as tensor names
Browse files Browse the repository at this point in the history
  • Loading branch information
barrywardell committed Mar 7, 2014
1 parent 240d14d commit dbf715e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Tools/CodeGen/xTensorKranc.m
Expand Up @@ -100,6 +100,8 @@
KrancScalarQ[s] = True;
]];

DefineTensor[(t_|t_[___]), ___] /; MemberQ[$KrancIndices, t] :=
ThrowError["Cannot use "<>SymbolName[t]<>" as a tensor as it is already used as a tensor index."];

(*************************************************************)
(* DefineDerivative *)
Expand Down

0 comments on commit dbf715e

Please sign in to comment.