Skip to content

Commit f30fb79

Browse files
authored
Merge pull request #25 from JuliaRobotics/dev/fix16
remove union types from VND
2 parents 1c664e6 + 072beee commit f30fb79

File tree

2 files changed

+22
-28
lines changed

2 files changed

+22
-28
lines changed

src/entities/DFGVariable.jl

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,34 +8,29 @@ mutable struct VariableNodeData
88
dimIDs::Array{Int,1} # Likely deprecate
99
dims::Int
1010
eliminated::Bool
11-
BayesNetVertID::Union{Nothing, Symbol} # TODO Drop union type from here
11+
BayesNetVertID::Symbol # Union{Nothing, }
1212
separator::Array{Symbol,1}
13-
groundtruth::Union{Nothing, Dict{ Tuple{Symbol, Vector{Float64}} } } # not packed yet
1413
softtype
1514
initialized::Bool
1615
partialinit::Bool
1716
ismargin::Bool
1817
dontmargin::Bool
1918
VariableNodeData() = new()
20-
# function VariableNodeData(x1,x2,x3,x4,x5,x6,x7,x8,x9)
21-
# @warn "Deprecated use of VariableNodeData(11 param), use 13 parameters instead"
22-
# new(x1,x2,x3,x4,x5,x6,x7,x8,x9, nothing, true, false, false) # TODO ensure this is initialized true is working for most cases
23-
# end
2419
VariableNodeData(x1::Array{Float64,2},
2520
x2::Array{Float64,2},
2621
x3::Vector{Symbol},
2722
x4::Vector{Int},
2823
x5::Int,
2924
x6::Bool,
30-
x7::Union{Nothing, Symbol},
25+
x7::Symbol,
3126
x8::Vector{Symbol},
32-
x9::Union{Nothing, Dict{ Tuple{Symbol, Vector{Float64}} } },
27+
# x9::Dict{ Tuple{Symbol, Vector{Float64}} }, # Union{Nothing, },
3328
x10,
3429
x11::Bool,
3530
x12::Bool,
3631
x13::Bool,
3732
x14::Bool) =
38-
new(x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14)
33+
new(x1,x2,x3,x4,x5,x6,x7,x8,x10,x11,x12,x13,x14)
3934
end
4035

4136
"""
@@ -46,34 +41,33 @@ mutable struct PackedVariableNodeData
4641
dimval::Int
4742
vecbw::Array{Float64,1}
4843
dimbw::Int
49-
BayesNetOutVertIDs::Array{Int,1}
44+
BayesNetOutVertIDs::Array{Symbol,1} # Int
5045
dimIDs::Array{Int,1}
5146
dims::Int
5247
eliminated::Bool
53-
BayesNetVertID::Int
54-
separator::Array{Int,1}
55-
# groundtruth::NothingUnion{ Dict{ Tuple{Symbol, Vector{Float64}} } }
48+
BayesNetVertID::Symbol # Int
49+
separator::Array{Symbol,1} # Int
5650
softtype::String
5751
initialized::Bool
5852
partialinit::Bool
5953
ismargin::Bool
6054
dontmargin::Bool
6155
PackedVariableNodeData() = new()
62-
PackedVariableNodeData(x5::Vector{Float64},
63-
x6::Int,
64-
x7::Vector{Float64},
65-
x8::Int,
66-
x9::Vector{Int},
67-
x10::Vector{Int},
68-
x11::Int,
56+
PackedVariableNodeData(x1::Vector{Float64},
57+
x2::Int,
58+
x3::Vector{Float64},
59+
x4::Int,
60+
x5::Vector{Symbol}, # Int
61+
x6::Vector{Int},
62+
x7::Int,
63+
x8::Bool,
64+
x9::Symbol, # Int
65+
x10::Vector{Symbol}, # Int
66+
x11::String,
6967
x12::Bool,
70-
x13::Int,
71-
x14::Vector{Int},
72-
x15::String,
73-
x16::Bool,
74-
x17::Bool,
75-
x18::Bool,
76-
x19::Bool ) = new(x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,x16,x17,x18,x19)
68+
x13::Bool,
69+
x14::Bool,
70+
x15::Bool ) = new(x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15)
7771
end
7872

7973
struct VariableEstimate

src/services/DFGVariable.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function unpack(dfg::Union{G, Nothing}, d::PackedVariableNodeData)::VariableNode
4141

4242
return VariableNodeData(M3,M4, d.BayesNetOutVertIDs,
4343
d.dimIDs, d.dims, d.eliminated, d.BayesNetVertID, d.separator,
44-
nothing, st, d.initialized, d.partialinit, d.ismargin, d.dontmargin )
44+
st, d.initialized, d.partialinit, d.ismargin, d.dontmargin )
4545
end
4646

4747
function compare(a::VariableNodeData,b::VariableNodeData)

0 commit comments

Comments
 (0)