@@ -8,7 +8,7 @@ $SIGNATURES
88
99Return the tags for a Node.
1010"""
11- getTags (node) = node. tags
11+ refTags (node) = node. tags
1212
1313"""
1414$SIGNATURES
@@ -105,22 +105,22 @@ end
105105
106106function listTags (dfg:: AbstractDFG , sym:: Symbol )
107107 getFnc = isVariable (dfg, sym) ? getVariable : getFactor
108- return getTags (getFnc (dfg, sym))
108+ return refTags (getFnc (dfg, sym))
109109end
110110
111111function mergeTags! (dfg:: InMemoryDFGTypes , sym:: Symbol , tags)
112112 getFnc = isVariable (dfg, sym) ? getVariable : getFactor
113- return union! (getTags (getFnc (dfg, sym)), tags)
113+ return union! (refTags (getFnc (dfg, sym)), tags)
114114end
115115
116116function removeTags! (dfg:: InMemoryDFGTypes , sym:: Symbol , tags)
117117 getFnc = isVariable (dfg, sym) ? getVariable : getFactor
118- return setdiff! (getTags (getFnc (dfg, sym)), tags)
118+ return setdiff! (refTags (getFnc (dfg, sym)), tags)
119119end
120120
121121function emptyTags! (dfg:: InMemoryDFGTypes , sym:: Symbol )
122122 getFnc = isVariable (dfg, sym) ? getVariable : getFactor
123- return empty! (getTags (getFnc (dfg, sym)))
123+ return empty! (refTags (getFnc (dfg, sym)))
124124end
125125
126126# #------------------------------------------------------------------------------
@@ -134,23 +134,5 @@ Determine if the variable or factor neighbors have the `tags:;Vector{Symbol}`, a
134134function hasTags (dfg:: AbstractDFG , sym:: Symbol , tags:: Vector{Symbol} ; matchAll:: Bool = true )
135135 #
136136 alltags = listTags (dfg, sym)
137- return length (filter (x -> x in alltags, tags)) >= (matchAll ? length (tags) : 1 )
138- end
139-
140- """
141- $SIGNATURES
142-
143- Determine if the variable or factor neighbors have the `tags:;Vector{Symbol}`, and `matchAll::Bool`.
144- """
145- function hasTagsNeighbors (
146- dfg:: AbstractDFG ,
147- sym:: Symbol ,
148- tags:: Vector{Symbol} ;
149- matchAll:: Bool = true ,
150- )
151- #
152- # assume only variables or factors are neighbors
153- getNeiFnc = isVariable (dfg, sym) ? getFactor : getVariable
154- alltags = union ((ls (dfg, sym) .| > x -> getTags (getNeiFnc (dfg, x))). .. )
155- return length (filter (x -> x in alltags, tags)) >= (matchAll ? length (tags) : 1 )
137+ return length (alltags ∩ tags) >= (matchAll ? length (tags) : 1 )
156138end
0 commit comments