Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/Serialization/services/DispatchPackedConversions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,23 @@ end
##

"""
$(SIGNATURES)
$(SIGNATURES)

After deserializing a factor using decodePackedType, use this to
completely rebuild the factor's CCW and user data.

Notes:
- This function is likely to be used for cache heavy factors, e.g. `ObjectAffordanceSubcloud`.

Dev Notes:
- TODO: We should only really do this in-memory if we can by without it (review this).
- TODO: needs testing
"""
function rebuildFactorMetadata!(
dfg::AbstractDFG{SolverParams},
factor::DFGFactor,
neighbors = map(vId -> getVariable(dfg, vId), getNeighbors(dfg, factor)),
neighbors = map(vId -> getVariable(dfg, vId), getNeighbors(dfg, factor));
_blockRecursionGradients::Bool=false
)
#
# Set up the neighbor data
Expand All @@ -100,6 +107,7 @@ function rebuildFactorMetadata!(
potentialused = fsd.potentialused,
edgeIDs = fsd.edgeIDs,
solveInProgress = fsd.solveInProgress,
_blockRecursion=_blockRecursionGradients
)
#

Expand Down
6 changes: 3 additions & 3 deletions src/services/FactorGraph.jl
Original file line number Diff line number Diff line change
Expand Up @@ -717,11 +717,11 @@ function getDefaultFactorData(
_blockRecursion::Bool = false,
) where {T <: AbstractFactor}
#

# prepare multihypo particulars
# storeMH::Vector{Float64} = multihypo == nothing ? Float64[] : [multihypo...]
mhcat, nh = parseusermultihypo(multihypo, nullhypo)

# allocate temporary state for convolutional operations (not stored)
userCache = preambleCache(dfg, Xi, usrfnc)
ccw = _prepCCW(
Expand All @@ -734,7 +734,7 @@ function getDefaultFactorData(
_blockRecursion,
userCache,
)

# and the factor data itself
return FunctionNodeData{typeof(ccw)}(
eliminated,
Expand Down