Skip to content

Commit 3f26c0a

Browse files
committed
small non-breaking change in indexnotation analyzers
1 parent d0aac69 commit 3f26c0a

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "TensorOperations"
22
uuid = "6aa20fa7-93e2-5fca-9bc0-fbd0db3c71a2"
33
authors = ["Jutho Haegeman"]
4-
version = "3.2.2"
4+
version = "3.2.3"
55

66
[deps]
77
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

src/indexnotation/analyzers.jl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,21 +80,23 @@ function getrhs(ex::Expr)
8080
end
8181
end
8282

83-
# get all the tensor objects in a tensor expression (not a definition or assignment)
84-
function gettensorobjects(ex)
83+
# get all the tensors and tensor objects in a tensor expression (not a definition or assignment)
84+
function gettensors(ex)
8585
if istensor(ex)
86-
Any[gettensorobject(ex)]
86+
Any[ex]
8787
elseif istensorexpr(ex)
8888
list = Any[]
8989
for e in ex.args
90-
append!(list, gettensorobjects(e))
90+
append!(list, gettensors(e))
9191
end
9292
return list
9393
else
9494
return Any[]
9595
end
9696
end
9797

98+
gettensorobjects(ex) = gettensorobject.(gettensors(ex))
99+
98100
# get all the existing tensor objects which are inputs (i.e. appear in the rhs of assignments and definitions)
99101
function getinputtensorobjects(ex)
100102
list = Any[]

0 commit comments

Comments
 (0)