1
+ # # ================================================================================================
2
+ # # Manifolds.jl Consolidation
3
+ # # TODO : Still to be completed and tested.
4
+ # # ================================================================================================
5
+ # struct ManifoldsVector <: Optim.Manifold
6
+ # manis::Vector{Manifold}
7
+ # end
1
8
2
- # #==============================================================================
3
- # # LEGACY, towards Sidecar
4
- # #==============================================================================
5
-
6
- """
7
- Converter: Prior -> PackedPrior::Dict{String, Any}
8
-
9
- FIXME see DFG #590 for consolidation with Serialization and Marshaling
10
- """
11
- function convert (:: Type{Dict{String, Any}} , prior:: IncrementalInference.Prior )
12
- @error (" Obsolete, use pack/unpack converters instead" )
13
- z = convert (Type{Dict{String, Any}}, prior. Z)
14
- return Packed_Factor ([z], " Prior" )
15
- end
16
-
17
- """
18
- Converter: PackedPrior::Dict{String, Any} -> Prior
19
-
20
- FIXME see DFG #590 for consolidation on Serialization and Marshaling
21
- """
22
- function convert (:: Type{<:Prior} , prior:: Dict{String, Any} )
23
- @error (" Obsolete, use pack/unpack converters instead" )
24
- # Genericize to any packed type next.
25
- z = prior[" measurement" ][1 ]
26
- z = convert (DFG. getTypeFromSerializationModule (z[" distType" ]), z)
27
- return Prior (z)
28
- end
29
-
30
- # more legacy, dont delete yet
31
- function Base. getproperty (ccw:: CommonConvWrapper , f:: Symbol )
32
- if f == :threadmodel
33
- @warn " CommonConvWrapper.threadmodel is obsolete" maxlog= 3
34
- return SingleThreaded
35
- elseif f == :params
36
- @warn " CommonConvWrapper.params is deprecated, use .varValsAll instead" maxlog= 3
37
- return ccw. varValsAll
38
- elseif f == :vartypes
39
- @warn " CommonConvWrapper.vartypes is deprecated, use typeof.(getVariableType.(ccw.fullvariables) instead" maxlog= 3
40
- return typeof .(getVariableType .(ccw. fullvariables))
41
- else
42
- return getfield (ccw, f)
43
- end
44
- end
45
-
46
-
47
- # #==============================================================================
48
- # # Deprecate code below before v0.33
49
- # #==============================================================================
50
-
51
- # export setThreadModel!
52
- # introduced for approximate convolution operations
53
- export SingleThreaded, MultiThreaded
54
-
55
- function setThreadModel! (fgl:: AbstractDFG ; model = IIF. SingleThreaded)
56
- #
57
- @error (" Obsolete, ThreadModel types are no longer in use." )
58
- # for (key, id) in fgl.fIDs
59
- # _getCCW(fgl, key).threadmodel = model
60
- # end
61
- return nothing
62
- end
9
+ # Base.getindex(mv::ManifoldsVector, inds...) = getindex(mv.mani, inds...)
10
+ # Base.setindex!(mv, X, inds...) = setindex!(mv.mani, X, inds...)
63
11
64
- # should have been deleted in v0.31 but no harm in keeping this one a bit longer
65
- @deprecate initManual! (w... ; kw... ) initVariable! (w... ; kw... )
12
+ # function ManifoldsVector(fg::AbstractDFG, varIds::Vector{Symbol})
13
+ # manis = Bool[]
14
+ # for k = varIds
15
+ # push!(manis, getVariableType(fg, k) |> getManifold)
16
+ # end
17
+ # ManifoldsVector(manis)
18
+ # end
66
19
20
+ # function Optim.retract!(manis::ManifoldsVector, x)
21
+ # for (i,M) = enumerate(manis)
22
+ # x[i] = project(M, x[i])
23
+ # end
24
+ # return x
25
+ # end
26
+ # function Optim.project_tangent!(manis::ManifoldsVector, G, x)
27
+ # for (i, M) = enumerate(manis)
28
+ # G[i] = project(M, x[i], G)
29
+ # end
30
+ # return G
31
+ # end
67
32
68
33
69
34
# #==============================================================================
@@ -146,34 +111,58 @@ function solveGraphParametric2(
146
111
return d, result, flatvar. idx, Σ
147
112
end
148
113
149
- # # ================================================================================================
150
- # # Manifolds.jl Consolidation
151
- # # TODO : Still to be completed and tested.
152
- # # ================================================================================================
153
- # struct ManifoldsVector <: Optim.Manifold
154
- # manis::Vector{Manifold}
155
- # end
156
114
157
- # Base.getindex(mv::ManifoldsVector, inds...) = getindex(mv.mani, inds...)
158
- # Base.setindex!(mv, X, inds...) = setindex!(mv.mani, X, inds...)
115
+ # #==============================================================================
116
+ # # Deprecate code below before v0.34
117
+ # #==============================================================================
159
118
160
- # function ManifoldsVector(fg::AbstractDFG, varIds::Vector{Symbol})
161
- # manis = Bool[]
162
- # for k = varIds
163
- # push!(manis, getVariableType(fg, k) |> getManifold)
164
- # end
165
- # ManifoldsVector(manis)
119
+ # function approxConvOnElements!(
120
+ # ccwl::Union{CommonConvWrapper{F}, CommonConvWrapper{Mixture{N_, F, S, T}}},
121
+ # elements::Union{Vector{Int}, UnitRange{Int}},
122
+ # ::Type{<:MultiThreaded},
123
+ # _slack = nothing,
124
+ # ) where {N_, F <: AbstractRelative, S, T}
125
+ # #
126
+ # return error(
127
+ # "MultiThreaded `approxConvOnElements!` is deprecated and will soon be replaced",
128
+ # )
129
+ # # Threads.@threads for n in elements
130
+ # # # ccwl.thrid_ = Threads.threadid()
131
+ # # ccwl.cpt[Threads.threadid()].particleidx = n
132
+
133
+ # # # ccall(:jl_, Nothing, (Any,), "starting loop, thrid_=$(Threads.threadid()), partidx=$(ccwl.cpt[Threads.threadid()].particleidx)")
134
+ # # _solveCCWNumeric!( ccwl, _slack=_slack)
135
+ # # end
136
+ # # nothing
166
137
# end
167
138
168
- # function Optim.retract!(manis::ManifoldsVector, x)
169
- # for (i,M) = enumerate(manis)
170
- # x[i] = project(M, x[i])
171
- # end
172
- # return x
173
- # end
174
- # function Optim.project_tangent!(manis::ManifoldsVector, G, x)
175
- # for (i, M) = enumerate(manis)
176
- # G[i] = project(M, x[i], G)
177
- # end
178
- # return G
139
+ # function approxConvOnElements!(
140
+ # ccwl::Union{CommonConvWrapper{F}, CommonConvWrapper{Mixture{N_, F, S, T}}},
141
+ # elements::Union{Vector{Int}, UnitRange{Int}},
142
+ # _slack = nothing,
143
+ # ) where {N_, F <: AbstractRelative, S, T}
144
+ # #
145
+ # return approxConvOnElements!(ccwl, elements, ccwl.threadmodel, _slack)
179
146
# end
147
+
148
+ # more legacy, dont delete yet
149
+ function Base. getproperty (ccw:: CommonConvWrapper , f:: Symbol )
150
+ if f == :threadmodel
151
+ error (" CommonConvWrapper.threadmodel is obsolete" )
152
+ # return SingleThreaded
153
+ elseif f == :params
154
+ error (" CommonConvWrapper.params is deprecated, use .varValsAll instead" )
155
+ return ccw. varValsAll
156
+ elseif f == :vartypes
157
+ @warn " CommonConvWrapper.vartypes is deprecated, use typeof.(getVariableType.(ccw.fullvariables) instead" maxlog= 3
158
+ return typeof .(getVariableType .(ccw. fullvariables))
159
+ else
160
+ return getfield (ccw, f)
161
+ end
162
+ end
163
+
164
+ # #==============================================================================
165
+ # # Deprecate code below before v0.35
166
+ # #==============================================================================
167
+
168
+ # #
0 commit comments