Skip to content

Commit ea52d6b

Browse files
committed
type unions on GenericFunctionNodeData
1 parent 089445c commit ea52d6b

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

src/entities/DFGFactor.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Designing (WIP)
3434
# in IIF.FunctorPairwiseMinimize <: InferenceType # DFG whatever, something, we'll figure it out
3535
# in Main/User, SomeFactor <: FunctorPairwiseMinimize
3636
"""
37-
mutable struct GenericFunctionNodeData{T, S} #{T<:Union{PackedInferenceType, FunctorInferenceType, FactorOperationalMemory}, S<:Union{Symbol, AbstractString}}
37+
mutable struct GenericFunctionNodeData{T<:Union{PackedInferenceType, FunctorInferenceType, FactorOperationalMemory}, S<:Union{Symbol, AbstractString}}
3838
fncargvID::Vector{Symbol}
3939
eliminated::Bool
4040
potentialused::Bool

test/DataStoreTests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dfg = LightDFG{NoSolverParams}()
88
struct TestInferenceVariable1 <: InferenceVariable end
99
v1 = DFGVariable(:a, TestInferenceVariable1())
1010
v2 = DFGVariable(:b, TestInferenceVariable1())
11-
f1 = DFGFactor{Int, :Symbol}(:f1)
11+
f1 = DFGFactor{TestFunctorInferenceType1, Symbol}(:f1)
1212
#add tags for filters
1313
union!(v1.tags, [:VARIABLE, :POSE])
1414
union!(v2.tags, [:VARIABLE, :LANDMARK])

test/compareTests.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ v2.solvable = 0
4242
@test !(DFGVariable(:x1, TestSofttype1()) == DFGVariable(:x1, TestSofttype2()))
4343

4444
# GenericFunctionNodeData
45-
gfnd1 = GenericFunctionNodeData([:a,:b], true, true, [1,2], :symbol, sin)
45+
gfnd1 = GenericFunctionNodeData([:a,:b], true, true, [1,2], :symbol, TestFunctorInferenceType1())
4646
gfnd2 = deepcopy(gfnd1)
47-
gfnd3 = GenericFunctionNodeData([:a,:b], true, true, [1,2], :symbol, cos)
47+
gfnd3 = GenericFunctionNodeData([:a,:b], true, true, [1,2], :symbol, TestFunctorInferenceType2())
4848

4949
@test gfnd1 == gfnd2
5050
@test !(gfnd1 == gfnd3)
@@ -72,9 +72,9 @@ vnd2.val[1] = 0.1
7272
@test !compare(vnd1, vnd2)
7373
@test !compare(vnd1, vnd3)
7474

75-
gfnd1 = GenericFunctionNodeData([:a,:b], true, true, [1,2], :symbol, sin)
75+
gfnd1 = GenericFunctionNodeData([:a,:b], true, true, [1,2], :symbol, TestFunctorInferenceType1())
7676
gfnd2 = deepcopy(gfnd1)
77-
gfnd3 = GenericFunctionNodeData([:a,:b], true, true, [1,2], :symbol, cos)
77+
gfnd3 = GenericFunctionNodeData([:a,:b], true, true, [1,2], :symbol, PackedTestFunctorInferenceType1())
7878

7979
@test compare(gfnd1, gfnd2)
8080
@test_broken !(compare(gfnd1, gfnd3))

test/needsahomeTests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ struct TestInferenceVariable2 <: InferenceVariable end
1010
# Build a graph
1111
v1 = DFGVariable(:a, TestInferenceVariable1())
1212
v2 = DFGVariable(:b, TestInferenceVariable1())
13-
f1 = DFGFactor{Int, :Symbol}(:f1)
13+
f1 = DFGFactor{TestFunctorInferenceType1, Symbol}(:f1)
1414
addVariable!(dfg, v1)
1515
addVariable!(dfg, v2)
1616
addFactor!(dfg, [v1, v2], f1)

test/plottingTest.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ numNodes = 10
1010
dfg = GraphsDFG{NoSolverParams}()
1111
verts = map(n -> DFGVariable(Symbol("x$n"), TestInferenceVariable1()), 1:numNodes)
1212
map(v -> addVariable!(dfg, v), verts)
13-
map(n -> addFactor!(dfg, [verts[n], verts[n+1]], DFGFactor{Int, :Symbol}(Symbol("x$(n)x$(n+1)f1"))), 1:(numNodes-1))
13+
map(n -> addFactor!(dfg, [verts[n], verts[n+1]], DFGFactor{TestFunctorInferenceType1, Symbol}(Symbol("x$(n)x$(n+1)f1"))), 1:(numNodes-1))
1414

1515
# Using GraphPlot plotting
1616
plot = dfgplot(dfg)

test/testBlocks.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ struct TestCCW{T} <: FactorOperationalMemory where {T<:FunctorInferenceType}
6161
end
6262
Base.:(==)(a::TestCCW, b::TestCCW) = a.usrfnc! == b.usrfnc!
6363

64-
DFG.getFactorOperationalMemoryType(par::NoSolverParams) = TestCCW
64+
DFG.getFactorOperationalMemoryType(par::NoSolverParams) = TestCCW
6565

6666
function Base.convert(::Type{DFG.FunctionNodeData{TestCCW{F}}},
6767
d::DFG.PackedFunctionNodeData{<:PackedInferenceType}) where F<:FunctorInferenceType
@@ -1203,7 +1203,7 @@ function ProducingDotFiles(testDFGAPI,
12031203
v2 = VARTYPE(:b, VariableNodeData{TestSofttype1}())
12041204
end
12051205
if f1 == nothing
1206-
f1 = (FACTYPE==DFGFactor) ? DFGFactor{Int, :Symbol}(:abf1) : FACTYPE(:abf1)
1206+
f1 = (FACTYPE==DFGFactor) ? DFGFactor{TestFunctorInferenceType1, Symbol}(:abf1) : FACTYPE(:abf1)
12071207
end
12081208

12091209
addVariable!(dotdfg, v1)

0 commit comments

Comments
 (0)