Skip to content

Commit 5608a56

Browse files
committed
fix wrong export and deprecate
1 parent def496c commit 5608a56

File tree

6 files changed

+49
-48
lines changed

6 files changed

+49
-48
lines changed

NEWS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ The list below highlights major breaking changes, and please note that significa
2323
- Deprecate use of `getParametricMeasurement` and use `getMeasurementParametric` instead, and add `<:AbstractManifold` to API.
2424
- Deprecate use of `solveBinaryFactorParameteric`, instead use `solveFactorParameteric`.
2525
- Deprecating `approxConvBinary`, use `approxConvBelief` instead.
26+
- Deprecating `accumulateFactorChain`, use `approxConvBelief` instead.
2627

2728

2829
# Major changes in v0.24

src/Deprecated.jl

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,49 @@ end
2626
##==============================================================================
2727

2828

29+
# """
30+
# $SIGNATURES
31+
32+
# Calculate both measured and predicted relative variable values, starting with `from` at zeros up to `to::Symbol`.
33+
34+
# Notes
35+
# - assume single variable separators only.
36+
37+
# DevNotes
38+
# - TODO better consolidate with [`approxConvBelief`](@ref) which can now also work with factor chains.
39+
# """
40+
# function accumulateFactorChain( dfg::AbstractDFG,
41+
# from::Symbol,
42+
# to::Symbol,
43+
# fsyms::Vector{Symbol}=findFactorsBetweenNaive(dfg, from, to);
44+
# initval=zeros(size(getVal(dfg, from))))
45+
46+
# # get associated variables
47+
# svars = union(ls.(dfg, fsyms)...)
48+
49+
# # use subgraph copys to do calculations
50+
# tfg_meas = buildSubgraph(dfg, [svars;fsyms])
51+
# tfg_pred = buildSubgraph(dfg, [svars;fsyms])
52+
53+
# # drive variable values manually to ensure no additional stochastics are introduced.
54+
# nextvar = from
55+
# initManual!(tfg_meas, nextvar, initval)
56+
# initManual!(tfg_pred, nextvar, initval)
57+
58+
# # nextfct = fsyms[1] # for debugging
59+
# for nextfct in fsyms
60+
# nextvars = setdiff(ls(tfg_meas,nextfct),[nextvar])
61+
# @assert length(nextvars) == 1 "accumulateFactorChain requires each factor pair to separated by a single variable"
62+
# nextvar = nextvars[1]
63+
# meas, pred = approxDeconv(dfg, nextfct) # solveFactorMeasurements
64+
# pts_meas = approxConv(tfg_meas, nextfct, nextvar, (meas,ones(Int,100),collect(1:100)))
65+
# pts_pred = approxConv(tfg_pred, nextfct, nextvar, (pred,ones(Int,100),collect(1:100)))
66+
# initManual!(tfg_meas, nextvar, pts_meas)
67+
# initManual!(tfg_pred, nextvar, pts_pred)
68+
# end
69+
# return getVal(tfg_meas,nextvar), getVal(tfg_pred,nextvar)
70+
# end
71+
2972

3073
# # TODO should this be consolidated with regular approxConv?
3174
# # TODO, perhaps pass Xi::Vector{DFGVariable} instead?

src/IncrementalInference.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,8 +392,7 @@ export *,
392392
getPointType,
393393
getPointIdentity,
394394
setVariableRefence!,
395-
reshapeVec2Mat,
396-
accumulateFactorChain
395+
reshapeVec2Mat
397396

398397
# more optional exports
399398
export HeatmapDensityRegular

src/ODE/DERelative.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ using .DifferentialEquations
55

66
import .DifferentialEquations: solve
77

8-
import IncrementalInference: getSample
8+
import IncrementalInference: getSample, getManifold
99

1010
export DERelative
1111

@@ -38,6 +38,7 @@ struct DERelative{T <:InferenceVariable, P, D} <: AbstractRelativeRoots
3838
specialSampler::Function
3939
end
4040

41+
getManifold(de::DERelative{T}) where T = getManifold(de.domain)
4142

4243
"""
4344
$SIGNATURES

src/TetherUtils.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
export cont2disc
44
export rebaseFactorVariable!
5-
export getFactorMean
5+
export accumulateFactorMeans
66
export solveFactorParameteric
77

88
"""

src/services/ApproxConv.jl

Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
export calcFactorResidual
3-
export accumulateFactorChain
3+
44

55

66
function approxConvBelief(dfg::AbstractDFG,
@@ -299,48 +299,5 @@ end
299299

300300

301301

302-
"""
303-
$SIGNATURES
304-
305-
Calculate both measured and predicted relative variable values, starting with `from` at zeros up to `to::Symbol`.
306-
307-
Notes
308-
- assume single variable separators only.
309-
310-
DevNotes
311-
- TODO better consolidate with [`approxConvBelief`](@ref) which can now also work with factor chains.
312-
"""
313-
function accumulateFactorChain( dfg::AbstractDFG,
314-
from::Symbol,
315-
to::Symbol,
316-
fsyms::Vector{Symbol}=findFactorsBetweenNaive(dfg, from, to);
317-
initval=zeros(size(getVal(dfg, from))))
318-
319-
# get associated variables
320-
svars = union(ls.(dfg, fsyms)...)
321-
322-
# use subgraph copys to do calculations
323-
tfg_meas = buildSubgraph(dfg, [svars;fsyms])
324-
tfg_pred = buildSubgraph(dfg, [svars;fsyms])
325-
326-
# drive variable values manually to ensure no additional stochastics are introduced.
327-
nextvar = from
328-
initManual!(tfg_meas, nextvar, initval)
329-
initManual!(tfg_pred, nextvar, initval)
330-
331-
# nextfct = fsyms[1] # for debugging
332-
for nextfct in fsyms
333-
nextvars = setdiff(ls(tfg_meas,nextfct),[nextvar])
334-
@assert length(nextvars) == 1 "accumulateFactorChain requires each factor pair to separated by a single variable"
335-
nextvar = nextvars[1]
336-
meas, pred = approxDeconv(dfg, nextfct) # solveFactorMeasurements
337-
pts_meas = approxConv(tfg_meas, nextfct, nextvar, (meas,ones(Int,100),collect(1:100)))
338-
pts_pred = approxConv(tfg_pred, nextfct, nextvar, (pred,ones(Int,100),collect(1:100)))
339-
initManual!(tfg_meas, nextvar, pts_meas)
340-
initManual!(tfg_pred, nextvar, pts_pred)
341-
end
342-
return getVal(tfg_meas,nextvar), getVal(tfg_pred,nextvar)
343-
end
344-
345302

346303
#

0 commit comments

Comments
 (0)