You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/GraphsDFG/services/GraphsDFG.jl
+8-13Lines changed: 8 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -447,19 +447,14 @@ end
447
447
448
448
"""
449
449
$(SIGNATURES)
450
-
Get a deep subgraph copy from the DFG given a list of variables and factors.
451
-
Optionally provide an existing subgraph addToDFG, the extracted nodes will be copied into this graph. By default a new subgraph will be created.
452
-
Note: By default orphaned factors (where the subgraph does not contain all the related variables) are not returned. Set includeOrphanFactors to return the orphans irrespective of whether the subgraph contains all the variables.
Optionally specify a label regular expression to retrieves a subset of the factors.
213
+
"""
214
+
# Alias
215
+
functionlsf(dfg::G, regexFilter::Union{Nothing, Regex}=nothing)::Vector{Symbol}where G <:AbstractDFG
216
+
returngetFactorIds(dfg, regexFilter)
217
+
end
218
+
219
+
"""
220
+
$(SIGNATURES)
221
+
Alias for getNeighbors - returns neighbors around a given node label.
222
+
"""
223
+
functionlsf(dfg::G, label::Symbol)::Vector{Symbol}where G <:AbstractDFG
224
+
returngetNeighbors(dfg, label)
225
+
end
226
+
227
+
"""
228
+
$(SIGNATURES)
229
+
Checks if the graph is fully connected, returns true if so.
230
+
"""
231
+
functionisFullyConnected(dfg::G)::Boolwhere G <:AbstractDFG
232
+
error("isFullyConnected not implemented for $(typeof(dfg))")
233
+
end
234
+
235
+
#Alias
236
+
"""
237
+
$(SIGNATURES)
238
+
Checks if the graph is not fully connected, returns true if it is not contiguous.
239
+
"""
240
+
functionhasOrphans(dfg::G)::Boolwhere G <:AbstractDFG
241
+
return!isFullyConnected(dfg)
242
+
end
243
+
244
+
"""
245
+
$(SIGNATURES)
246
+
Retrieve a list of labels of the immediate neighbors around a given variable or factor.
247
+
"""
248
+
functiongetNeighbors(dfg::G, node::T; ready::Union{Nothing, Int}=nothing, backendset::Union{Nothing, Int}=nothing)::Vector{Symbol}where {G <:AbstractDFG, T <:DFGNode}
249
+
error("getNeighbors not implemented for $(typeof(dfg))")
250
+
end
251
+
"""
252
+
$(SIGNATURES)
253
+
Retrieve a list of labels of the immediate neighbors around a given variable or factor specified by its label.
254
+
"""
255
+
functiongetNeighbors(dfg::G, label::Symbol; ready::Union{Nothing, Int}=nothing, backendset::Union{Nothing, Int}=nothing)::Vector{Symbol}where G <:AbstractDFG
256
+
error("getNeighbors not implemented for $(typeof(dfg))")
257
+
end
258
+
259
+
# Aliases
260
+
"""
261
+
$(SIGNATURES)
262
+
Retrieve a list of labels of the immediate neighbors around a given variable or factor.
263
+
"""
264
+
functionls(dfg::G, node::T)::Vector{Symbol}where {G <:AbstractDFG, T <:DFGNode}
265
+
returngetNeighbors(dfg, node)
266
+
end
267
+
"""
268
+
$(SIGNATURES)
269
+
Retrieve a list of labels of the immediate neighbors around a given variable or factor specified by its label.
270
+
"""
271
+
functionls(dfg::G, label::Symbol)::Vector{Symbol}where G <:AbstractDFG
272
+
returngetNeighbors(dfg, label)
273
+
end
274
+
275
+
"""
276
+
$(SIGNATURES)
277
+
Gets an empty and unique CloudGraphsDFG derived from an existing DFG.
278
+
"""
279
+
function_getDuplicatedEmptyDFG(dfg::G)::Gwhere G <:AbstractDFG
280
+
error("_getDuplicatedEmptyDFG not implemented for $(typeof(dfg))")
281
+
end
282
+
283
+
#TODO: NEED TO FIGURE OUT SIGNATURE FOR DEFAULT ARGS
284
+
285
+
"""
286
+
$(SIGNATURES)
287
+
Retrieve a deep subgraph copy around a given variable or factor.
288
+
Optionally provide a distance to specify the number of edges should be followed.
289
+
Optionally provide an existing subgraph addToDFG, the extracted nodes will be copied into this graph. By default a new subgraph will be created.
290
+
Note: By default orphaned factors (where the subgraph does not contain all the related variables) are not returned. Set includeOrphanFactors to return the orphans irrespective of whether the subgraph contains all the variables.
291
+
"""
292
+
functiongetSubgraphAroundNode(dfg::G, node::T, distance::Int64=1, includeOrphanFactors::Bool=false, addToDFG::H=_getDuplicatedEmptyDFG(dfg))::Gwhere {G <:AbstractDFG, H <:AbstractDFG, P <:AbstractParams, T <:DFGNode}
293
+
error("getSubgraphAroundNode not implemented for $(typeof(dfg))")
294
+
end
295
+
296
+
"""
297
+
$(SIGNATURES)
298
+
Get a deep subgraph copy from the DFG given a list of variables and factors.
299
+
Optionally provide an existing subgraph addToDFG, the extracted nodes will be copied into this graph. By default a new subgraph will be created.
300
+
Note: By default orphaned factors (where the subgraph does not contain all the related variables) are not returned. Set includeOrphanFactors to return the orphans irrespective of whether the subgraph contains all the variables.
301
+
"""
302
+
functiongetSubgraph(dfg::G,
303
+
variableFactorLabels::Vector{Symbol},
304
+
includeOrphanFactors::Bool=false,
305
+
addToDFG::H=_getDuplicatedEmptyDFG(dfg))::Hwhere {G <:AbstractDFG, H <:AbstractDFG}
306
+
for label in variableFactorLabels
307
+
if!exists(dfg, label)
308
+
error("Variable/factor with label '$(label)' does not exist in the factor graph")
0 commit comments