|
1 | 1 | dfg = testDFGAPI{NoSolverParams}()
|
2 |
| -v1 = DFGVariable(:a) |
3 |
| -v2 = DFGVariable(:b) |
| 2 | + |
| 3 | +#add types for softtypes |
| 4 | +struct TestInferenceVariable1 <: InferenceVariable end |
| 5 | +struct TestInferenceVariable2 <: InferenceVariable end |
| 6 | + |
| 7 | +v1 = DFGVariable(:a, TestInferenceVariable1()) |
| 8 | +v2 = DFGVariable(:b, TestInferenceVariable2()) |
4 | 9 | f1 = DFGFactor{Int, :Symbol}(:f1)
|
5 | 10 |
|
6 | 11 | #add tags for filters
|
7 | 12 | append!(v1.tags, [:VARIABLE, :POSE])
|
8 | 13 | append!(v2.tags, [:VARIABLE, :LANDMARK])
|
9 | 14 | append!(f1.tags, [:FACTOR])
|
10 | 15 |
|
11 |
| -#add types for softtypes |
12 |
| -struct TestInferenceVariable1 <: InferenceVariable end |
13 |
| -struct TestInferenceVariable2 <: InferenceVariable end |
14 |
| - |
15 | 16 | st1 = TestInferenceVariable1()
|
16 | 17 | st2 = TestInferenceVariable2()
|
17 | 18 |
|
@@ -39,9 +40,9 @@ addFactor!(dfg, [v1, v2], f1)
|
39 | 40 |
|
40 | 41 | @testset "Adding Removing Nodes" begin
|
41 | 42 | dfg2 = testDFGAPI{NoSolverParams}()
|
42 |
| - v1 = DFGVariable(:a) |
43 |
| - v2 = DFGVariable(:b) |
44 |
| - v3 = DFGVariable(:c) |
| 43 | + v1 = DFGVariable(:a, TestInferenceVariable1()) |
| 44 | + v2 = DFGVariable(:b, TestInferenceVariable1()) |
| 45 | + v3 = DFGVariable(:c, TestInferenceVariable1()) |
45 | 46 | f1 = DFGFactor{Int, :Symbol}(:f1)
|
46 | 47 | f2 = DFGFactor{Int, :Symbol}(:f2)
|
47 | 48 | # @testset "Creating Graphs" begin
|
@@ -277,14 +278,15 @@ end
|
277 | 278 | # Now make a complex graph for connectivity tests
|
278 | 279 | numNodes = 10
|
279 | 280 | dfg = testDFGAPI{NoSolverParams}()
|
280 |
| -verts = map(n -> DFGVariable(Symbol("x$n")), 1:numNodes) |
| 281 | +verts = map(n -> DFGVariable(Symbol("x$n"), TestInferenceVariable1()), 1:numNodes) |
281 | 282 | #change ready and backendset for x7,x8 for improved tests on x7x8f1
|
282 | 283 | verts[7].ready = 1
|
283 | 284 | verts[8].backendset = 1
|
284 | 285 |
|
285 |
| -#force softytypes to first 2 vertices. |
286 |
| -verts[1].solverDataDict[:default].softtype = deepcopy(st1) |
287 |
| -verts[2].solverDataDict[:default].softtype = deepcopy(st2) |
| 286 | +# Can't change the softtypes now. |
| 287 | +# #force softytypes to first 2 vertices. |
| 288 | +# verts[1].solverDataDict[:default].softtype = deepcopy(st1) |
| 289 | +# verts[2].solverDataDict[:default].softtype = deepcopy(st2) |
288 | 290 |
|
289 | 291 | map(v -> addVariable!(dfg, v), verts)
|
290 | 292 | map(n -> addFactor!(dfg, [verts[n], verts[n+1]], DFGFactor{Int, :Symbol}(Symbol("x$(n)x$(n+1)f1"))), 1:(numNodes-1))
|
|
376 | 378 | @testset "Producing Dot Files" begin
|
377 | 379 | # create a simpler graph for dot testing
|
378 | 380 | dotdfg = testDFGAPI{NoSolverParams}()
|
379 |
| - v1 = DFGVariable(:a) |
380 |
| - v2 = DFGVariable(:b) |
| 381 | + v1 = DFGVariable(:a, TestInferenceVariable1()) |
| 382 | + v2 = DFGVariable(:b, TestInferenceVariable1()) |
381 | 383 | f1 = DFGFactor{Int, :Symbol}(:f1)
|
382 | 384 | addVariable!(dotdfg, v1)
|
383 | 385 | addVariable!(dotdfg, v2)
|
|
0 commit comments