|
26 | 26 | ##============================================================================== |
27 | 27 |
|
28 | 28 |
|
| 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 | + |
29 | 72 |
|
30 | 73 | # # TODO should this be consolidated with regular approxConv? |
31 | 74 | # # TODO, perhaps pass Xi::Vector{DFGVariable} instead? |
|
0 commit comments