aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Tools/CodeGen/TensorTools.m12
1 files changed, 10 insertions, 2 deletions
diff --git a/Tools/CodeGen/TensorTools.m b/Tools/CodeGen/TensorTools.m
index 23e6617..c946b9a 100644
--- a/Tools/CodeGen/TensorTools.m
+++ b/Tools/CodeGen/TensorTools.m
@@ -540,8 +540,16 @@ makeSum[x_ == y_] :=
makeSum[x_ -> y_] :=
makeSum[x] -> makeSum[y];
-makeSum[x_] :=
- makeSumOverDummies[x, dummiesIn[x]];
+makeSum[f_[x___]] :=
+ Module[{xs2},
+ xs2 = Map[makeSum, {x}];
+ Apply[f, xs2]];
+
+makeSum[x_?nontensorialQ] :=
+ x;
+
+makeSum[x_] :=
+ Throw["Expression " <> ToString[x] <> " is not recognized, and tensor indices will not be expanded"];
sumComponentsOfDummyIndex[x_, i_] :=
Apply[Plus,listComponents[x, i, toggleIndex[i]]];