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/needsahome.jl
+71-56Lines changed: 71 additions & 56 deletions
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,9 @@ Notes
14
14
- Slighly messy internals, but gets the job done -- some room for performance improvement.
15
15
- Defaults to GraphDFG, but likely to change to LightDFG in future.
16
16
17
+
DevNotes
18
+
- TODO: still needs to be consolidated with `DFG._copyIntoGraph`
19
+
17
20
Related
18
21
19
22
getVariableIds, _copyIntoGraph!
@@ -45,6 +48,16 @@ function buildSubgraphFromLabels!(dfg::G,
45
48
deleteVariable!(subfg, dv)
46
49
end
47
50
51
+
# delete any factors not in the allowed list
52
+
if allowedFactors !=nothing
53
+
delFcts =setdiff(lsf(subfg), allowedFactors)
54
+
for dfct in delFcts
55
+
deleteFactor!(subfg, dfct)
56
+
end
57
+
end
58
+
59
+
# orphaned variables are allowed, but not orphaned factors
60
+
48
61
return subfg
49
62
end
50
63
@@ -59,59 +72,61 @@ function buildSubgraphFromLabels(dfg::G,
59
72
end
60
73
61
74
62
-
"""
63
-
$SIGNATURES
64
-
65
-
IIF clique specific version of building subgraphs. This is was an unfortunate rewrite of the existing `buildSubgraphFromLabels!` function above. Currently halfway consolidated. Tests required to ensure these two functions can be reduced to and will perform the same in both.
66
-
67
-
DevNotes
68
-
- DF: Could we somehow better consolidate the functionality of this method into `buildSubgraphFromLabels!` above, which in turn should be consolidated as SamC suggests.
69
-
- Since this function has happened more than once, it seems the name `buildSubgraphFromLabels!` might stick around, even if it just becomes a wrapper.
## KEEPING COMMENT, WANT TO BE CONSOLIDATED WITH FUNCTION ABOVE -- KEEPING ONLY ONE FOR MAINTAINABILITY
76
+
## STILL NEEDS TO BE CONSOLIDATED WITH `DFG._copyIntoGraph`
77
+
# """
78
+
# $SIGNATURES
79
+
#
80
+
# IIF clique specific version of building subgraphs. This is was an unfortunate rewrite of the existing `buildSubgraphFromLabels!` function above. Currently halfway consolidated. Tests required to ensure these two functions can be reduced to and will perform the same in both.
81
+
#
82
+
# DevNotes
83
+
# - DF: Could we somehow better consolidate the functionality of this method into `buildSubgraphFromLabels!` above, which in turn should be consolidated as SamC suggests.
84
+
# - Since this function has happened more than once, it seems the name `buildSubgraphFromLabels!` might stick around, even if it just becomes a wrapper.
0 commit comments