@@ -292,22 +292,19 @@ end
292
292
$(SIGNATURES)
293
293
Checks if the graph is fully connected, returns true if so.
294
294
"""
295
- function isFullyConnected (dfg:: G ):: Bool where G <: AbstractDFG
295
+ function isFullyConnected (dfg:: AbstractDFG ):: Bool
296
296
error (" isFullyConnected not implemented for $(typeof (dfg)) " )
297
297
end
298
298
299
299
"""
300
300
$(SIGNATURES)
301
301
Retrieve a list of labels of the immediate neighbors around a given variable or factor specified by its label.
302
302
"""
303
- function getNeighbors (dfg:: G , label:: Symbol ; solvable:: Int = 0 ):: Vector{Symbol} where G <: AbstractDFG
304
- error (" getNeighbors not implemented for $(typeof (dfg)) " )
305
- end
306
- # #TODO reduce with getNeighbors(dfg, node.label)
307
- function getNeighbors (dfg:: G , node:: T ; solvable:: Int = 0 ):: Vector{Symbol} where {G <: AbstractDFG , T <: DFGNode }
303
+ function getNeighbors (dfg:: AbstractDFG , label:: Symbol ; solvable:: Int = 0 ):: Vector{Symbol}
308
304
error (" getNeighbors not implemented for $(typeof (dfg)) " )
309
305
end
310
306
307
+
311
308
# #------------------------------------------------------------------------------
312
309
# # copy and duplication
313
310
# #------------------------------------------------------------------------------
416
413
# #------------------------------------------------------------------------------
417
414
# # Connectivity Alias
418
415
# #------------------------------------------------------------------------------
416
+
417
+ function getNeighbors (dfg:: AbstractDFG , node:: DFGNode ; solvable:: Int = 0 ):: Vector{Symbol}
418
+ getNeighbors (dfg, node. label, solvable= solvable)
419
+ end
420
+
419
421
# Alias
420
422
# TODO rather actually check if there are orphaned factors (factors without all variables)
421
423
"""
457
459
Get a list of the IDs (labels) of the DFGFactors in the DFG.
458
460
Optionally specify a label regular expression to retrieves a subset of the factors.
459
461
"""
460
- function listFactors (dfg:: G , regexFilter:: Union{Nothing, Regex} = nothing ; solvable:: Int = 0 ):: Vector{Symbol} where G <: AbstractDFG
461
- return map (f -> f. label, getFactors (dfg, regexFilter, solvable= solvable))
462
+ function listFactors (dfg:: G , regexFilter:: Union{Nothing, Regex} = nothing ; tags :: Vector{Symbol} = Symbol[], solvable:: Int = 0 ):: Vector{Symbol} where G <: AbstractDFG
463
+ return map (f -> f. label, getFactors (dfg, regexFilter, tags = tags, solvable= solvable))
462
464
end
463
465
464
466
# #------------------------------------------------------------------------------
485
487
List the DFGFactors in the DFG.
486
488
Optionally specify a label regular expression to retrieves a subset of the factors.
487
489
"""
488
- function lsf (dfg:: G , regexFilter:: Union{Nothing, Regex} = nothing ; solvable:: Int = 0 ):: Vector{Symbol} where G <: AbstractDFG
489
- return listFactors (dfg, regexFilter, solvable= solvable)
490
+ function lsf (dfg:: G , regexFilter:: Union{Nothing, Regex} = nothing ; tags :: Vector{Symbol} = Symbol[], solvable:: Int = 0 ):: Vector{Symbol} where G <: AbstractDFG
491
+ return listFactors (dfg, regexFilter, tags = tags, solvable= solvable)
490
492
end
491
493
492
494
0 commit comments