@@ -17,99 +17,102 @@ Fields:
17
17
$(TYPEDFIELDS)
18
18
"""
19
19
Base. @kwdef mutable struct VariableNodeData{T<: InferenceVariable , P}
20
- id:: Union{UUID, Nothing} # If it's blank it doesn't exist in the DB.
20
+ id:: Union{UUID, Nothing} = nothing # If it's blank it doesn't exist in the DB.
21
21
val:: Vector{P}
22
- bw:: Matrix{Float64}
23
- BayesNetOutVertIDs:: Vector{Symbol}
24
- dimIDs:: Vector{Int} # Likely deprecate
22
+ bw:: Matrix{Float64} = zeros ( 0 , 0 )
23
+ BayesNetOutVertIDs:: Vector{Symbol} = Symbol[]
24
+ dimIDs:: Vector{Int} = Int[] # Likely deprecate
25
25
26
- dims:: Int
27
- eliminated:: Bool
28
- BayesNetVertID:: Symbol # Union{Nothing, }
29
- separator:: Vector{Symbol}
26
+ dims:: Int = 0
27
+ eliminated:: Bool = false
28
+ BayesNetVertID:: Symbol = :NOTHING # Union{Nothing, }
29
+ separator:: Vector{Symbol} = Symbol[]
30
30
31
31
variableType:: T
32
- initialized:: Bool
32
+ initialized:: Bool = false
33
33
"""
34
34
Replacing previous `inferdim::Float64`, new `.infoPerCoord::Vector{Float64}` will in
35
35
future stores the amount information (per measurement dimension) captured in each
36
36
coordinate dimension.
37
37
"""
38
- infoPerCoord:: Vector{Float64}
39
- ismargin:: Bool
38
+ infoPerCoord:: Vector{Float64} = Float64[ 0.0 ;]
39
+ ismargin:: Bool = false
40
40
41
- dontmargin:: Bool
42
- solveInProgress:: Int
43
- solvedCount:: Int
41
+ dontmargin:: Bool = false
42
+ solveInProgress:: Int = 0
43
+ solvedCount:: Int = 0
44
44
solveKey:: Symbol
45
45
46
- events:: Dict{Symbol,Threads.Condition}
47
-
48
- VariableNodeData {T,P} (w... ) where {T <: InferenceVariable , P} = new {T,P} (w... )
49
- VariableNodeData {T,P} (;solveKey:: Symbol = :default ) where {T <: InferenceVariable , P} = new {T,P} (
50
- nothing ,
51
- Vector {P} (),
52
- zeros (0 ,0 ),
53
- Symbol[],
54
- Int[],
55
- 0 ,
56
- false ,
57
- :NOTHING ,
58
- Symbol[],
59
- T (),
60
- false ,
61
- Float64[0.0 ;],
62
- false ,
63
- false ,
64
- 0 ,
65
- 0 ,
66
- solveKey,
67
- Dict {Symbol,Threads.Condition} () )
46
+ events:: Dict{Symbol,Threads.Condition} = Dict {Symbol,Threads.Condition} ()
47
+
48
+ # VariableNodeData{T,P}(w...) where {T <:InferenceVariable, P} = new{T,P}(w...)
49
+ # VariableNodeData{T,P}(;solveKey::Symbol=:default ) where {T <:InferenceVariable, P} = new{T,P}(
50
+ # nothing,
51
+ # Vector{P}(),
52
+ # zeros(0,0),
53
+ # Symbol[],
54
+ # Int[],
55
+ # 0,
56
+ # false,
57
+ # :NOTHING,
58
+ # Symbol[],
59
+ # T(),
60
+ # false,
61
+ # Float64[0.0;],
62
+ # false,
63
+ # false,
64
+ # 0,
65
+ # 0,
66
+ # solveKey,
67
+ # Dict{Symbol,Threads.Condition}() )
68
68
#
69
69
end
70
70
71
+
71
72
# #------------------------------------------------------------------------------
72
73
# # Constructors
73
74
74
- VariableNodeData {T} (;solveKey:: Symbol = :default ) where T <: InferenceVariable = VariableNodeData {T, getPointType(T)} (solveKey= solveKey)
75
-
76
- VariableNodeData ( val:: Vector{P} ,
77
- bw:: AbstractMatrix{<:Real} ,
78
- BayesNetOutVertIDs:: AbstractVector{Symbol} ,
79
- dimIDs:: AbstractVector{Int} ,
80
- dims:: Int ,
81
- eliminated:: Bool ,
82
- BayesNetVertID:: Symbol ,
83
- separator:: AbstractVector{Symbol} ,
84
- variableType:: T ,
85
- initialized:: Bool ,
86
- ipc:: AbstractVector{<:Real} ,
87
- ismargin:: Bool ,
88
- dontmargin:: Bool ,
89
- solveInProgress:: Int = 0 ,
90
- solvedCount:: Int = 0 ,
91
- solveKey:: Symbol = :default ,
92
- events:: Dict{Symbol,Threads.Condition} = Dict {Symbol,Threads.Condition} ();
93
- id:: Union{UUID, Nothing} = nothing
94
- ) where {T <: InferenceVariable , P} =
95
- VariableNodeData {T,P} ( id, val,bw,BayesNetOutVertIDs,dimIDs,dims,
96
- eliminated,BayesNetVertID,separator,
97
- variableType,initialized,ipc,ismargin,
98
- dontmargin, solveInProgress, solvedCount,
99
- solveKey, events )
75
+ VariableNodeData {T,P} (;solveKey:: Symbol = :default ) where {T <: InferenceVariable , P} = VariableNodeData (; val= Vector {P} (), variableType= T (), solveKey)
76
+ VariableNodeData {T} (;solveKey:: Symbol = :default ) where T <: InferenceVariable = VariableNodeData (; solveKey, variableType= T (), val= Vector {getPointType(T)} ()) # {T, getPointType(T)}
77
+
78
+ # VariableNodeData( val::Vector{P},
79
+ # bw::AbstractMatrix{<:Real},
80
+ # BayesNetOutVertIDs::AbstractVector{Symbol},
81
+ # dimIDs::AbstractVector{Int},
82
+ # dims::Int,
83
+ # eliminated::Bool,
84
+ # BayesNetVertID::Symbol,
85
+ # separator::AbstractVector{Symbol},
86
+ # variableType::T,
87
+ # initialized::Bool,
88
+ # ipc::AbstractVector{<:Real},
89
+ # ismargin::Bool,
90
+ # dontmargin::Bool,
91
+ # solveInProgress::Int=0,
92
+ # solvedCount::Int=0,
93
+ # solveKey::Symbol=:default,
94
+ # events::Dict{Symbol,Threads.Condition}=Dict{Symbol,Threads.Condition}();
95
+ # id::Union{UUID, Nothing}=nothing
96
+ # ) where {T <: InferenceVariable, P} =
97
+ # VariableNodeData{T,P}( id, val,bw,BayesNetOutVertIDs,dimIDs,dims,
98
+ # eliminated,BayesNetVertID,separator,
99
+ # variableType,initialized,ipc,ismargin,
100
+ # dontmargin, solveInProgress, solvedCount,
101
+ # solveKey, events )
100
102
#
101
103
102
104
function VariableNodeData (variableType:: T ; solveKey:: Symbol = :default ) where T <: InferenceVariable
103
105
#
104
106
# p0 = getPointIdentity(T)
105
- P0 = Vector {getPointType(T)} ()
107
+ val = Vector {getPointType(T)} ()
106
108
# P0[1] = p0
107
- BW = zeros (0 ,0 )
108
- # BW[1] = zeros(getDimension(T))
109
- VariableNodeData ( P0, BW, Symbol[], Int[],
110
- 0 , false , :NOTHING , Symbol[],
111
- variableType, false , [0.0 ], false ,
112
- false , 0 , 0 , solveKey )
109
+ bw = zeros (0 ,0 )
110
+ # bw[1] = zeros(getDimension(T))
111
+ VariableNodeData (; val, bw, solveKey, variableType )
112
+ # VariableNodeData( nothing, P0, BW, Symbol[], Int[],
113
+ # 0, false, :NOTHING, Symbol[],
114
+ # variableType, false, [0.0], false,
115
+ # false, 0, 0, solveKey )
113
116
end
114
117
115
118
0 commit comments