Skip to content

Commit 4281b25

Browse files
committed
keep solve, refac ApproxConv
1 parent 6f4c3f9 commit 4281b25

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

IncrementalInference/src/services/ApproxConv.jl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ function approxConvBelief(
1010
N::Int = length(measurement),
1111
nullSurplus::Real = 0,
1212
skipSolve::Bool = false,
13+
keepCalcFactor::Union{Nothing, <:Channel} = nothing,
1314
)
1415
#
1516
v_trg = getVariable(dfg, target)
@@ -25,7 +26,8 @@ function approxConvBelief(
2526
solveKey,
2627
N,
2728
skipSolve,
28-
nullSurplus
29+
nullSurplus,
30+
keepCalcFactor
2931
)
3032

3133
len = length(ipc)
@@ -85,6 +87,7 @@ function approxConvBelief(
8587
path::AbstractVector{Symbol} = Symbol[],
8688
skipSolve::Bool = false,
8789
nullSurplus::Real = 0,
90+
keepCalcFactor::Union{Nothing, <:Channel} = nothing,
8891
)
8992
#
9093
# @assert isVariable(dfg, target) "approxConv(dfg, from, target,...) where `target`=$target must be a variable in `dfg`"
@@ -137,6 +140,7 @@ function approxConvBelief(
137140
N,
138141
skipSolve,
139142
nullSurplus,
143+
keepCalcFactor,
140144
)
141145
if length(path) == 2
142146
return pts1Bel
@@ -155,7 +159,7 @@ function approxConvBelief(
155159
# this is a factor path[idx]
156160
fct = getFactor(dfg, path[idx])
157161
addFactor!(tfg, fct)
158-
ptsBel = approxConvBelief(tfg, fct, path[idx + 1]; solveKey, N, skipSolve)
162+
ptsBel = approxConvBelief(tfg, fct, path[idx + 1]; solveKey, N, skipSolve, keepCalcFactor)
159163
initVariable!(tfg, path[idx + 1], ptsBel)
160164
!setPPE ? nothing : setPPE!(tfg, path[idx + 1], solveKey, ppemethod)
161165
end
@@ -184,10 +188,11 @@ function calcProposalBelief(
184188
solveKey::Symbol = :default,
185189
nullSurplus::Real = 0,
186190
dbg::Bool = false,
191+
keepCalcFactor::Union{Nothing, <:Channel} = nothing,
187192
)
188193
#
189194
# assuming it is properly initialized TODO
190-
proposal = approxConvBelief(dfg, fct, target, measurement; solveKey, N, nullSurplus)
195+
proposal = approxConvBelief(dfg, fct, target, measurement; solveKey, N, nullSurplus, keepCalcFactor)
191196

192197
# return the proposal belief and inferdim, NOTE likely to be changed
193198
return proposal

0 commit comments

Comments
 (0)