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
#kan ek die in bulk copy, soos graph en dan nuwe map maak
320
318
# Add all variables first,
321
319
labels = [sourceDFG.g.labels[i] for i in ns]
@@ -334,7 +332,7 @@ function _copyIntoGraph!(sourceDFG::LightDFG, destDFG::LightDFG, ns::Vector{Int}
334
332
335
333
neigh_labels = [sourceDFG.g.labels[i] for i in neigh_ints]
336
334
# Find the labels and associated variables in our new subgraph
337
-
factVariables =DFGVariable[]
335
+
factVariables =V[]
338
336
for v_lab in neigh_labels
339
337
ifhaskey(destDFG.g.variables, v_lab)
340
338
push!(factVariables, getVariable(destDFG, v_lab))
@@ -359,7 +357,7 @@ Optionally provide a distance to specify the number of edges should be followed.
359
357
Optionally provide an existing subgraph addToDFG, the extracted nodes will be copied into this graph. By default a new subgraph will be created.
360
358
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.
functiongetSubgraphAroundNode(dfg::LightDFG{P,V,F}, node::DFGNode, distance::Int64=1, includeOrphanFactors::Bool=false, addToDFG::LightDFG=LightDFG{P,V,F}())::LightDFGwhere {P <:AbstractParams, V <:AbstractDFGVariable, F <:AbstractDFGFactor}
363
361
if!exists(dfg,node.label)
364
362
error("Variable/factor with label '$(node.label)' does not exist in the factor graph")
365
363
end
@@ -372,17 +370,18 @@ function getSubgraphAroundNode(dfg::LightDFG, node::DFGNode, distance::Int64=1,
372
370
return addToDFG
373
371
374
372
end
375
-
373
+
# dfg::LightDFG{P,V,F}
374
+
# where {P <: AbstractParams, V <: AbstractDFGVariable, F <: AbstractDFGFactor}
376
375
377
376
"""
378
377
$(SIGNATURES)
379
378
Get a deep subgraph copy from the DFG given a list of variables and factors.
380
379
Optionally provide an existing subgraph addToDFG, the extracted nodes will be copied into this graph. By default a new subgraph will be created.
381
380
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.
functiongetSubgraph(dfg::LightDFG{P,V,F}, variableFactorLabels::Vector{Symbol}, includeOrphanFactors::Bool=false, addToDFG::LightDFG=LightDFG{P,V,F}())::LightDFGwhere {P <:AbstractParams, V <:AbstractDFGVariable, F <:AbstractDFGFactor}
383
+
for label in variableFactorLabels
384
+
if!exists(dfg, label)
386
385
error("Variable/factor with label '$(label)' does not exist in the factor graph")
0 commit comments