@@ -155,11 +155,11 @@ function deleteFactor!(dfg::LightDFG, label::Symbol)::AbstractDFGFactor
155
155
return factor
156
156
end
157
157
158
- function getVariables (dfg:: LightDFG , regexFilter:: Union{Nothing, Regex} = nothing ; tags:: Vector{Symbol} = Symbol[], solvable:: Int = 0 ):: Vector{AbstractDFGVariable}
158
+ function getVariables (dfg:: LightDFG , regexFilter:: Union{Nothing, Regex} = nothing ; tags:: Vector{Symbol} = Symbol[], solvable:: Int = 0 )
159
159
160
160
# variables = map(v -> v.dfgNode, filter(n -> n.dfgNode isa DFGVariable, vertices(dfg.g)))
161
161
variables = collect (values (dfg. g. variables))
162
- if regexFilter != nothing
162
+ if regexFilter != = nothing
163
163
variables = filter (v -> occursin (regexFilter, String (v. label)), variables)
164
164
end
165
165
if solvable != 0
@@ -172,20 +172,20 @@ function getVariables(dfg::LightDFG, regexFilter::Union{Nothing, Regex}=nothing;
172
172
return variables
173
173
end
174
174
175
- function listVariables (dfg:: LightDFG , regexFilter:: Union{Nothing, Regex} = nothing ; tags:: Vector{Symbol} = Symbol[], solvable:: Int = 0 ):: Vector{Symbol}
175
+ function listVariables (dfg:: LightDFG , regexFilter:: Union{Nothing, Regex} = nothing ; tags:: Vector{Symbol} = Symbol[], solvable:: Int = 0 )
176
176
177
177
# variables = map(v -> v.dfgNode, filter(n -> n.dfgNode isa DFGVariable, vertices(dfg.g)))
178
178
if length (tags) > 0
179
179
return map (v -> v. label, getVariables (dfg, regexFilter, tags= tags, solvable= solvable))
180
180
else
181
181
variables = collect (keys (dfg. g. variables))
182
- regexFilter != nothing && (variables = filter (v -> occursin (regexFilter, String (v)), variables))
182
+ regexFilter != = nothing && (variables = filter (v -> occursin (regexFilter, String (v)), variables))
183
183
solvable != 0 && (variables = filter (vId -> _isSolvable (dfg, vId, solvable), variables))
184
- return variables
184
+ return variables:: Vector{Symbol}
185
185
end
186
186
end
187
187
188
- function getFactors (dfg:: LightDFG , regexFilter:: Union{Nothing, Regex} = nothing ; tags:: Vector{Symbol} = Symbol[], solvable:: Int = 0 ):: Vector{AbstractDFGFactor}
188
+ function getFactors (dfg:: LightDFG , regexFilter:: Union{Nothing, Regex} = nothing ; tags:: Vector{Symbol} = Symbol[], solvable:: Int = 0 )
189
189
# factors = map(v -> v.dfgNode, filter(n -> n.dfgNode isa DFGFactor, vertices(dfg.g)))
190
190
factors = collect (values (dfg. g. factors))
191
191
if regexFilter != nothing
@@ -201,7 +201,7 @@ function getFactors(dfg::LightDFG, regexFilter::Union{Nothing, Regex}=nothing; t
201
201
return factors
202
202
end
203
203
204
- function listFactors (dfg:: LightDFG , regexFilter:: Union{Nothing, Regex} = nothing ; tags:: Vector{Symbol} = Symbol[], solvable:: Int = 0 ):: Vector{Symbol}
204
+ function listFactors (dfg:: LightDFG , regexFilter:: Union{Nothing, Regex} = nothing ; tags:: Vector{Symbol} = Symbol[], solvable:: Int = 0 )
205
205
# factors = map(v -> v.dfgNode, filter(n -> n.dfgNode isa DFGFactor, vertices(dfg.g)))
206
206
if length (tags) > 0
207
207
return map (v -> v. label, getFactors (dfg, regexFilter, tags= tags, solvable= solvable))
@@ -213,7 +213,7 @@ function listFactors(dfg::LightDFG, regexFilter::Union{Nothing, Regex}=nothing;
213
213
if solvable != 0
214
214
factors = filter (fId -> _isSolvable (dfg, fId, solvable), factors)
215
215
end
216
- return factors
216
+ return factors:: Vector{Symbol}
217
217
end
218
218
219
219
function isConnected (dfg:: LightDFG ):: Bool
@@ -231,7 +231,7 @@ function _isSolvable(dfg::LightDFG, label::Symbol, ready::Int)::Bool
231
231
return false
232
232
end
233
233
234
- function getNeighbors (dfg:: LightDFG , node:: DFGNode ; solvable:: Int = 0 ):: Vector{Symbol}
234
+ function getNeighbors (dfg:: LightDFG , node:: DFGNode ; solvable:: Int = 0 )
235
235
label = node. label
236
236
if ! exists (dfg, label)
237
237
error (" Variable/factor with label '$(node. label) ' does not exist in the factor graph" )
@@ -248,7 +248,7 @@ function getNeighbors(dfg::LightDFG, node::DFGNode; solvable::Int=0)::Vector{Sym
248
248
return order
249
249
end
250
250
251
- return neighbors_ll
251
+ return neighbors_ll:: Vector{Symbol}
252
252
end
253
253
254
254
0 commit comments