Skip to content

Commit bbde17c

Browse files
committed
Unused State eliminated, BayesNetOutVertIDs,BayesNetVertID
1 parent 6da156d commit bbde17c

4 files changed

Lines changed: 28 additions & 32 deletions

File tree

src/entities/DFGVariable.jl

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ Base.@kwdef mutable struct State{T <: StateType, P, N}
3333
"Parametric (Gaussian) covariance."
3434
covar::Vector{SMatrix{N, N, Float64}} =
3535
SMatrix{getDimension(T), getDimension(T), Float64}[]
36-
BayesNetOutVertIDs::Vector{Symbol} = Symbol[] #TODO looks unused?
36+
# BayesNetOutVertIDs::Vector{Symbol} = Symbol[] #TODO looks unused?
3737

3838
dims::Int = getDimension(T) #TODO should we deprecate in favor of N
39-
"""
40-
Flag used by junction (Bayes) tree construction algorithm to know whether this variable has yet been included in the tree construction.
41-
"""
42-
eliminated::Bool = false
43-
BayesNetVertID::Symbol = :NOTHING # Union{Nothing, } #TODO deprecate
39+
# """
40+
# Flag used by junction (Bayes) tree construction algorithm to know whether this variable has yet been included in the tree construction.
41+
# """
42+
# eliminated::Bool = false
43+
# BayesNetVertID::Symbol = :NOTHING # Union{Nothing, } #TODO deprecate
4444
separator::Vector{Symbol} = Symbol[]
4545
"""
4646
False if initial numerical values are not yet available or stored values are not ready for further processing yet.
@@ -106,10 +106,10 @@ Base.@kwdef mutable struct PackedState
106106
dimval::Int
107107
vecbw::Vector{Float64}
108108
dimbw::Int
109-
BayesNetOutVertIDs::Vector{Symbol} # Int
109+
# BayesNetOutVertIDs::Vector{Symbol} # Int
110110
dims::Int
111-
eliminated::Bool # TODO Questionable usage, set but never read?
112-
BayesNetVertID::Symbol # Int #TODO deprecate
111+
# eliminated::Bool # TODO Questionable usage, set but never read?
112+
# BayesNetVertID::Symbol # Int #TODO deprecate
113113
separator::Vector{Symbol} # Int #TODO maybe remove from State and have in variable only.
114114
variableType::String
115115
initialized::Bool
@@ -187,7 +187,7 @@ StructUtils.@kwarg struct VariableDFG{T <: StateType, P, N} <: AbstractGraphVari
187187
_autotype::Nothing = nothing & (name = :type, lower = _ -> TypeMetadata(VariableDFG))
188188
end
189189

190-
refStates(v::VariableCompute) = v.states
190+
refStates(v::VariableDFG) = v.states
191191

192192
const VariableCompute = VariableDFG
193193
##------------------------------------------------------------------------------
@@ -215,10 +215,6 @@ function VariableCompute(
215215
return VariableCompute{T, P, N}(; label, timestamp, solvable, kwargs...)
216216
end
217217

218-
function VariableCompute(label::Symbol, variableType::StateType; kwargs...)
219-
return VariableCompute(label, typeof(variableType); kwargs...)
220-
end
221-
222218
function VariableCompute(label::Symbol, state::State; kwargs...)
223219
return VariableCompute(;
224220
label,

src/services/CompareUtils.jl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -196,15 +196,15 @@ end
196196
function compare(a::State, b::State)
197197
a.val != b.val && @debug("val is not equal") === nothing && return false
198198
a.bw != b.bw && @debug("bw is not equal") === nothing && return false
199-
a.BayesNetOutVertIDs != b.BayesNetOutVertIDs &&
200-
@debug("BayesNetOutVertIDs is not equal") === nothing &&
201-
return false
202-
a.eliminated != b.eliminated &&
203-
@debug("eliminated is not equal") === nothing &&
204-
return false
205-
a.BayesNetVertID != b.BayesNetVertID &&
206-
@debug("BayesNetVertID is not equal") === nothing &&
207-
return false
199+
# a.BayesNetOutVertIDs != b.BayesNetOutVertIDs &&
200+
# @debug("BayesNetOutVertIDs is not equal") === nothing &&
201+
# return false
202+
# a.eliminated != b.eliminated &&
203+
# @debug("eliminated is not equal") === nothing &&
204+
# return false
205+
# a.BayesNetVertID != b.BayesNetVertID &&
206+
# @debug("BayesNetVertID is not equal") === nothing &&
207+
# return false
208208
a.separator != b.separator &&
209209
@debug("separator is not equal") === nothing &&
210210
return false

src/services/Serialization.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ function packState(d::State{T}) where {T <: StateType}
8080
size(castval, 1),
8181
d.bw[:],
8282
size(d.bw, 1),
83-
d.BayesNetOutVertIDs,
84-
d.eliminated,
85-
d.BayesNetVertID,
83+
# d.BayesNetOutVertIDs,
84+
# d.eliminated,
85+
# d.BayesNetVertID,
8686
d.separator,
8787
stringVariableType(getVariableType(d)),
8888
d.initialized,
@@ -129,9 +129,9 @@ function unpackState(d::PackedState)
129129
bw = BW,
130130
#TODO only one covar is currently supported in packed VND
131131
covar = isempty(d.covar) ? SMatrix{N, N, Float64}[] : [d.covar],
132-
BayesNetOutVertIDs = Symbol.(d.BayesNetOutVertIDs),
133-
eliminated = d.eliminated,
134-
BayesNetVertID = Symbol(d.BayesNetVertID),
132+
# BayesNetOutVertIDs = Symbol.(d.BayesNetOutVertIDs),
133+
# eliminated = d.eliminated,
134+
# BayesNetVertID = Symbol(d.BayesNetVertID),
135135
separator = Symbol.(d.separator),
136136
initialized = d.initialized,
137137
infoPerCoord = d.infoPerCoord,

test/testBlocks.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1547,11 +1547,11 @@ function FileDFGTestBlock(testDFGAPI; kwargs...)
15471547
v4 = getVariable(dfg, :x4)
15481548
vnd = getState(v4, :default)
15491549
# set everything
1550-
vnd.BayesNetVertID = :outid
1551-
push!(vnd.BayesNetOutVertIDs, :id)
1550+
# vnd.BayesNetVertID = :outid
1551+
# push!(vnd.BayesNetOutVertIDs, :id)
15521552
# vnd.bw[1] = [1.0;]
15531553
vnd.dontmargin = true
1554-
vnd.eliminated = true
1554+
# vnd.eliminated = true
15551555
vnd.infoPerCoord .= Float64[1.5;]
15561556
vnd.initialized = true
15571557
vnd.ismargin = true

0 commit comments

Comments
 (0)