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
# error("estimateDict is deprecated, use ppeDict instead")
78
-
if f ==:solvable
79
-
getfield(x,:_dfgNodeParams).solvable = val
80
-
elseif f ==:_internalId
81
-
getfield(x,:_dfgNodeParams)._internalId = val
82
-
else
83
-
setfield!(x,f,val)
84
-
end
85
-
end
86
-
87
-
88
-
#NOTE deprecate in favor of constructors because its not lossless: https://docs.julialang.org/en/v1/manual/conversion-and-promotion/#Conversion-vs.-Construction-1
89
-
function Base.convert(::Type{DFGVariableSummary}, v::DFGVariable)
90
-
Base.depwarn("convert to type DFGVariableSummary is deprecated use the constructor", :convert)
91
-
returnDFGVariableSummary(v)
92
-
end
93
-
94
-
function Base.convert(::Type{SkeletonDFGVariable}, v::VariableDataLevel1)
95
-
Base.depwarn("convert to type SkeletonDFGVariable is deprecated use the constructor", :convert)
96
-
returnSkeletonDFGVariable(v)
97
30
end
98
31
99
-
function Base.convert(::Type{DFGFactorSummary}, f::DFGFactor)
100
-
Base.depwarn("convert to type DFGFactorSummary is deprecated use the constructor", :convert)
101
-
returnDFGFactorSummary(f)
102
-
end
103
-
104
-
function Base.convert(::Type{SkeletonDFGFactor}, f::FactorDataLevel1)
105
-
Base.depwarn("convert to type SkeletonDFGFactor is deprecated use the constructor", :convert)
Retrieve a deep subgraph copy around a given variable or factor.
176
-
Optionally provide a distance to specify the number of edges should be followed.
177
-
Optionally provide an existing subgraph addToDFG, the extracted nodes will be copied into this graph. By default a new subgraph will be created.
178
-
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.
179
-
Note: Always returns the node at the center, but filters around it if solvable is set.
Get a deep subgraph copy from the DFG given a list of variables and factors.
202
-
Optionally provide an existing subgraph addToDFG, the extracted nodes will be copied into this graph. By default a new subgraph will be created.
203
-
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.
204
-
"""
205
-
functiongetSubgraph(dfg::G,
206
-
variableFactorLabels::Vector{Symbol},
207
-
includeOrphanFactors::Bool=false,
208
-
addToDFG::H=_getDuplicatedEmptyDFG(dfg))::Hwhere {G <:AbstractDFG, H <:AbstractDFG}
209
-
210
-
Base.depwarn("getSubgraph is deprecated use buildSubgraph", :getSubgraph)
211
-
212
-
for label in variableFactorLabels
213
-
if!exists(dfg, label)
214
-
error("Variable/factor with label '$(label)' does not exist in the factor graph")
#TODO needsahome: home should be in IIF, calling just deepcopyGraph, or copyGraph
224
-
# Into, Labels, Subgraph are all implied from the parameters.
225
-
# can alies names but like Sam suggested only on copy is needed.
226
-
227
-
228
-
"""
229
-
$SIGNATURES
230
-
Construct a new factor graph object as a subgraph of `dfg <: AbstractDFG` based on the
231
-
variable labels `syms::Vector{Symbols}`.
232
-
233
-
SamC: Can we not just use _copyIntoGraph! for this? Looks like a small refactor to make it work.
234
-
Will paste in as-is for now and we can figure it out as we go.
235
-
DF: Absolutely agree that subgraph functions should use `DFG._copyIntoGraph!` as a single dependency in the code base. There have been a repeated new rewrites of IIF.buildSubGraphFromLabels (basic wrapper is fine) but nominal should be to NOT duplicate DFG functionality in IIF -- rather use/improve the existing features in DFG. FYI, I have repeatedly refactored this function over and over to use DFG properly but somehow this (add/delete/Variable/Factor) version keeps coming back without using `_copyIntoGraph`!!??? See latest effort commented out below `buildSubgraphFromLabels!_SPECIAL`...
236
-
237
-
Notes
238
-
- Slighly messy internals, but gets the job done -- some room for performance improvement.
239
-
- Defaults to GraphDFG, but likely to change to LightDFG in future.
240
-
- since DFG v0.6 LightDFG is the default.
241
-
242
-
DevNotes
243
-
- TODO: still needs to be consolidated with `DFG._copyIntoGraph`
244
-
245
-
Related
246
-
247
-
listVariables, _copyIntoGraph!
248
-
"""
249
-
functionbuildSubgraphFromLabels!(dfg::G,
250
-
syms::Vector{Symbol};
251
-
subfg::AbstractDFG=(G <:InMemoryDFGTypes? G : GraphsDFG)(params=getSolverParams(dfg)),
252
-
solvable::Int=0,
253
-
allowedFactors::Union{Nothing, Vector{Symbol}}=nothing )::AbstractDFGwhere G <:AbstractDFG
254
-
#
255
-
Base.depwarn("buildSubgraphFromLabels! is deprecated use copyGraph, buildSubgraph or buildCliqueSubgraph!(IIF)", :buildSubgraphFromLabels!)
256
-
# add a little too many variables (since we need the factors)
0 commit comments