|
85 | 85 | $(SIGNATURES)
|
86 | 86 | Get a DFGVariable from a DFG using its underlying integer ID.
|
87 | 87 | """
|
88 |
| -function getVariable(dfg::G, variableId::Int64)::DFGVariable where G <: AbstractDFG |
| 88 | +function getVariable(dfg::G, variableId::Int64)::AbstractDFGVariable where G <: AbstractDFG |
89 | 89 | error("getVariable not implemented for $(typeof(dfg))")
|
90 | 90 | end
|
91 | 91 |
|
92 | 92 | """
|
93 | 93 | $(SIGNATURES)
|
94 | 94 | Get a DFGVariable from a DFG using its label.
|
95 | 95 | """
|
96 |
| -function getVariable(dfg::G, label::Union{Symbol, String})::DFGVariable where G <: AbstractDFG |
| 96 | +function getVariable(dfg::G, label::Union{Symbol, String})::AbstractDFGVariable where G <: AbstractDFG |
97 | 97 | return getVariable(dfg, Symbol(label))
|
98 | 98 | end
|
99 | 99 |
|
100 | 100 | """
|
101 | 101 | $(SIGNATURES)
|
102 | 102 | Get a DFGFactor from a DFG using its underlying integer ID.
|
103 | 103 | """
|
104 |
| -function getFactor(dfg::G, factorId::Int64)::DFGFactor where G <: AbstractDFG |
| 104 | +function getFactor(dfg::G, factorId::Int64)::AbstractDFGFactor where G <: AbstractDFG |
105 | 105 | error("getFactor not implemented for $(typeof(dfg))")
|
106 | 106 | end
|
107 | 107 |
|
108 | 108 | """
|
109 | 109 | $(SIGNATURES)
|
110 | 110 | Get a DFGFactor from a DFG using its label.
|
111 | 111 | """
|
112 |
| -function getFactor(dfg::G, label::Union{Symbol, String})::DFGFactor where G <: AbstractDFG |
| 112 | +function getFactor(dfg::G, label::Union{Symbol, String})::AbstractDFGFactor where G <: AbstractDFG |
113 | 113 | return getFactor(dfg, Symbol(label))
|
114 | 114 | end
|
115 | 115 |
|
116 | 116 | """
|
117 | 117 | $(SIGNATURES)
|
118 | 118 | Update a complete DFGVariable in the DFG.
|
119 | 119 | """
|
120 |
| -function updateVariable!(dfg::G, variable::V)::DFGVariable where {G <: AbstractDFG, V <: AbstractDFGVariable} |
| 120 | +function updateVariable!(dfg::G, variable::V)::AbstractDFGVariable where {G <: AbstractDFG, V <: AbstractDFGVariable} |
121 | 121 | error("updateVariable! not implemented for $(typeof(dfg))")
|
122 | 122 | end
|
123 | 123 |
|
124 | 124 | """
|
125 | 125 | $(SIGNATURES)
|
126 | 126 | Update a complete DFGFactor in the DFG.
|
127 | 127 | """
|
128 |
| -function updateFactor!(dfg::G, factor::F)::DFGFactor where {G <: AbstractDFG, F <: AbstractDFGFactor} |
| 128 | +function updateFactor!(dfg::G, factor::F)::AbstractDFGFactor where {G <: AbstractDFG, F <: AbstractDFGFactor} |
129 | 129 | error("updateFactor! not implemented for $(typeof(dfg))")
|
130 | 130 | end
|
131 | 131 |
|
@@ -470,13 +470,14 @@ Returns state of vertex data `.initialized` flag.
|
470 | 470 |
|
471 | 471 | Notes:
|
472 | 472 | - used by both factor graph variable and Bayes tree clique logic.
|
473 |
| -TODO: Refactor |
474 | 473 | """
|
475 | 474 | function isInitialized(var::DFGVariable; key::Symbol=:default)::Bool
|
476 |
| - return var.solverDataDict[key].initialized |
| 475 | + solverData(var, key) && return solverData(var, key).initialized |
| 476 | + return false |
477 | 477 | end
|
478 | 478 | function isInitialized(fct::DFGFactor; key::Symbol=:default)::Bool
|
479 |
| - return fct.solverDataDict[key].initialized |
| 479 | + solverData(var, key) && return solverData(fct, key).initialized |
| 480 | + return false |
480 | 481 | end
|
481 | 482 | function isInitialized(dfg::G, label::Symbol; key::Symbol=:default)::Bool where G <: AbstractDFG
|
482 | 483 | return isInitialized(getVariable(dfg, label), key=key)
|
|
0 commit comments