@@ -5,7 +5,7 @@ struct SingletonInferenceVariable <: InferenceVariable end
5
5
"""
6
6
$(TYPEDEF)
7
7
"""
8
- mutable struct VariableNodeData # TODO v0.5.0 {T<:InferenceVariable}
8
+ mutable struct VariableNodeData{T<: InferenceVariable }
9
9
val:: Array{Float64,2}
10
10
bw:: Array{Float64,2}
11
11
BayesNetOutVertIDs:: Array{Symbol,1}
@@ -14,7 +14,7 @@ mutable struct VariableNodeData #TODO v0.5.0 {T<:InferenceVariable}
14
14
eliminated:: Bool
15
15
BayesNetVertID:: Symbol # Union{Nothing, }
16
16
separator:: Array{Symbol,1}
17
- softtype:: InferenceVariable # TODO v0.5.0 T
17
+ softtype:: T
18
18
initialized:: Bool
19
19
inferdim:: Float64
20
20
ismargin:: Bool
@@ -24,7 +24,21 @@ mutable struct VariableNodeData #TODO v0.5.0 {T<:InferenceVariable}
24
24
# A valid, packable default constructor is needed.
25
25
26
26
end
27
- VariableNodeData () = VariableNodeData (zeros (1 ,1 ), zeros (1 ,1 ), Symbol[], Int[], 0 , false , :NOTHING , Symbol[], SingletonInferenceVariable (), false , 0.0 , false , false )
27
+
28
+ VariableNodeData (params... ) = VariableNodeData {InferenceVariable} (params... )
29
+
30
+ function VariableNodeData ()
31
+ st = stacktrace ()
32
+ @warn " VariableNodeData() is depreciated please use VariableNodeData{T}() or VariableNodeData(softtype::T) where T <: InferenceVariable. Enable DEBUG logging for stack trace."
33
+ @debug st
34
+ VariableNodeData {InferenceVariable} (zeros (1 ,1 ), zeros (1 ,1 ), Symbol[], Int[], 0 , false , :NOTHING , Symbol[], SingletonInferenceVariable (), false , 0.0 , false , false )
35
+ end
36
+
37
+ VariableNodeData {T} () where {T <: InferenceVariable } =
38
+ VariableNodeData {T} (zeros (1 ,1 ), zeros (1 ,1 ), Symbol[], Int[], 0 , false , :NOTHING , Symbol[], T (), false , 0.0 , false , false )
39
+
40
+ VariableNodeData (softtype:: T ) where T <: InferenceVariable =
41
+ VariableNodeData {T} (zeros (1 ,1 ), zeros (1 ,1 ), Symbol[], Int[], 0 , false , :NOTHING , Symbol[], softtype, false , 0.0 , false , false )
28
42
29
43
"""
30
44
$(TYPEDEF)
@@ -109,11 +123,30 @@ end
109
123
$SIGNATURES
110
124
DFGVariable constructors.
111
125
"""
112
- DFGVariable (label:: Symbol , _internalId:: Int64 ) =
113
- DFGVariable (label, now (), Symbol[], Dict {Symbol, MeanMaxPPE} (), Dict {Symbol, VariableNodeData} (:default => VariableNodeData ()), Dict {String, String} (), Dict {Symbol,AbstractBigDataEntry} (), 0 , 0 , _internalId)
114
-
115
- DFGVariable (label:: Symbol ) =
116
- DFGVariable (label, now (), Symbol[], Dict {Symbol, MeanMaxPPE} (), Dict {Symbol, VariableNodeData} (:default => VariableNodeData ()), Dict {String, String} (), Dict {Symbol,AbstractBigDataEntry} (), 0 , 0 , 0 )
126
+ function DFGVariable (label:: Symbol , _internalId:: Int64 = 0 ) # where {T <:InferenceVariable}
127
+ st = stacktrace ()
128
+ @warn " DFGVariable(label::Symbol, _internalId::Int64 = 0) is depreciated please use DFGVariable(label::Symbol, softtype::T, _internalId::Int64 = 0) where T <: InferenceVariable. Enable DEBUG logging for the stack trace."
129
+ @debug st
130
+ T = InferenceVariable
131
+ DFGVariable (label, now (), Symbol[],
132
+ Dict {Symbol, MeanMaxPPE} (),
133
+ Dict {Symbol, VariableNodeData{T}} (:default => VariableNodeData ()),
134
+ Dict {String, String} (),
135
+ Dict {Symbol,AbstractBigDataEntry} (), 0 , 0 , _internalId)
136
+ end
137
+ DFGVariable (label:: Symbol , softtype:: T , _internalId:: Int64 = 0 ) where {T <: InferenceVariable } =
138
+ DFGVariable (label, now (), Symbol[],
139
+ Dict {Symbol, MeanMaxPPE} (),
140
+ Dict {Symbol, VariableNodeData{T}} (:default => VariableNodeData {T} ()),
141
+ Dict {String, String} (),
142
+ Dict {Symbol,AbstractBigDataEntry} (), 0 , 0 , _internalId)
143
+
144
+ # DFGVariable(label::Symbol, _internalId::Int64) =
145
+ # DFGVariable(label, now(), Symbol[], Dict{Symbol, Dict{Symbol, VariableEstimate}}(), Dict{Symbol, VariableNodeData}(:default => VariableNodeData()), Dict{String, String}(), Dict{Symbol,AbstractBigDataEntry}(), 0, 0, _internalId)
146
+ #
147
+ # DFGVariable(label::Symbol) =
148
+ # DFGVariable(label, now(), Symbol[], Dict{Symbol, VariableEstimate}(), Dict{Symbol, VariableNodeData}(:default => VariableNodeData()), Dict{String, String}(), Dict{Symbol,AbstractBigDataEntry}(), 0, 0, 0)
149
+ #
117
150
118
151
# Accessors
119
152
label (v:: DFGVariable ) = v. label
0 commit comments