aboutsummaryrefslogtreecommitdiff
path: root/Tools/CodeGen
diff options
context:
space:
mode:
authorIan Hinder <ian.hinder@aei.mpg.de>2011-06-10 22:31:23 +0200
committerIan Hinder <ian.hinder@aei.mpg.de>2011-06-11 03:47:30 +0200
commit216385dbca32325749f88b9dd3cda85705d800a0 (patch)
tree11de25dbbe5d88d62b041d697490a8c1b1b3ea94 /Tools/CodeGen
parent25d10c9c3c8133a9caefbe1e6ecbd4b5e234105d (diff)
TensorTools.m: Improve output formatting of tensor expressions
Diffstat (limited to 'Tools/CodeGen')
-rw-r--r--Tools/CodeGen/TensorTools.m16
1 files changed, 4 insertions, 12 deletions
diff --git a/Tools/CodeGen/TensorTools.m b/Tools/CodeGen/TensorTools.m
index 6579c63..23e6617 100644
--- a/Tools/CodeGen/TensorTools.m
+++ b/Tools/CodeGen/TensorTools.m
@@ -248,16 +248,11 @@ defineIndices[];
DefineTensor[T_] :=
Module[{},
+ Format[Tensor[T, is:((TensorIndex[_,_] | _Integer) ..) ], StandardForm] :=
+ Row[{T,is}]/.x_Integer->Subscript[null,x];
- Format[Tensor[T, is:((TensorIndex[_,_] | _Integer) ..) ], StandardForm] :=
- PrecedenceForm[
- SequenceForm[T,"[",Sequence@@Riffle[{is},","],"]"],
- 10000];
-
- Format[Tensor[T, is:((TensorIndex[_,_] | _Integer) ..) ], OutputForm] :=
- PrecedenceForm[
- SequenceForm[T,"[",Sequence@@Riffle[{is},","],"]"],
- 10000];
+ Format[Tensor[T, is:((TensorIndex[_,_] | _Integer) ..) ], OutputForm] :=
+ Row[{T,"[",Sequence@@Riffle[{is},","],"]"}];
(* Cannot get InputForm to work *)
@@ -395,9 +390,6 @@ Times[TensorProduct[], x_] = x;
Format[x_ t:TensorProduct[((Tensor[__] | CD[__] | PD[__] | FD[__]) ..)]] :=
SequenceForm[x," ",t];
-Format[x_ t:Tensor[__]] :=
- SequenceForm[x," ",t];
-
Protect[Times];
Format[TensorProduct[t:((Tensor[__] | CD[__] | PD[__] | FD[__]) ..)]] :=