Skip to content

Commit c068e35

Browse files
committed
update compareFactor, bump v0.18.11
1 parent 5a0d8e3 commit c068e35

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "DistributedFactorGraphs"
22
uuid = "b5cc3c7e-6572-11e9-2517-99fb8daf2f04"
3-
version = "0.18.10"
3+
version = "0.18.11"
44

55
[deps]
66
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

src/entities/DFGFactor.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ abstract type AbstractPackedFactor end
88

99
abstract type AbstractPrior <: AbstractFactor end
1010
abstract type AbstractRelative <: AbstractFactor end
11-
abstract type AbstractRelativeRoots <: AbstractRelative end
11+
abstract type AbstractRelativeRoots <: AbstractRelative end # NOTE Cannot be used for partials
1212
abstract type AbstractRelativeMinimize <: AbstractRelative end
1313
abstract type AbstractManifoldMinimize <: AbstractRelative end # FIXME move here from IIF
1414

src/services/CompareUtils.jl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,9 @@ end
234234
$SIGNATURES
235235
236236
Compare that all fields are the same in a `::FactorGraph` factor.
237+
238+
DevNotes
239+
- TODO `getSolverData(A).fnc.varValsAll / varidx` are only defined downstream, so should should this function not be in IIF?
237240
"""
238241
function compareFactor(A::DFGFactor,
239242
B::DFGFactor;
@@ -256,11 +259,12 @@ function compareFactor(A::DFGFactor,
256259
TP = TP & (skipsamples || compareAll(getSolverData(A).fnc.measurement, getSolverData(B).fnc.measurement, show=show, skip=skip))
257260
end
258261
@debug "compareFactor 4/5" TP
259-
if !(:params in skip)
260-
TP = TP & (skipcompute || compareAll(getSolverData(A).fnc.params, getSolverData(B).fnc.params, show=show, skip=skip))
262+
if !(:varValsAll in skip) && hasfield(typeof(getSolverData(A).fnc), :varValsAll)
263+
TP = TP & (skipcompute || compareAll(getSolverData(A).fnc.varValsAll, getSolverData(B).fnc.varValsAll, show=show, skip=skip))
261264
end
262-
if !(:varidx in skip)
263-
TP = TP & (skipcompute || compareAll(getSolverData(A).fnc.varidx, getSolverData(B).fnc.varidx, show=show, skip=skip))
265+
@debug "compareFactor 5/5" TP
266+
if !(:varidx in skip) && hasfield(typeof(getSolverData(A).fnc), :varidx) && getSolverData(A).fnc.varidx isa Base.RefValue
267+
TP = TP & (skipcompute || compareAll(getSolverData(A).fnc.varidx[], getSolverData(B).fnc.varidx[], show=show, skip=skip))
264268
end
265269

266270
return TP

0 commit comments

Comments
 (0)