27
27
vertex_index (v:: GraphsNode ) = v. index
28
28
29
29
# Exports
30
- export GraphsDFG
30
+ export GraphsDFG, InMemoryParams
31
31
export exists
32
32
export getLabelDict, getDescription, setDescription, getInnerGraph, getAddHistory, getSolverParams, setSolverParams
33
33
@@ -45,20 +45,37 @@ export getSubgraph
45
45
export isFullyConnected, hasOrphans
46
46
export toDot, toDotFile
47
47
48
- mutable struct GraphsDFG <: AbstractDFG
48
+ abstract type SolverParams end
49
+
50
+ mutable struct InMemoryParams <: SolverParams
51
+ qfl:: Int
52
+ isfixedlag:: Bool
53
+ end
54
+
55
+ mutable struct GraphsDFG{T<: SolverParams } <: AbstractDFG
49
56
g:: FGType
50
57
description:: String
51
58
nodeCounter:: Int64
52
59
labelDict:: Dict{Symbol, Int64}
53
60
addHistory:: Vector{Symbol} # TODO : Discuss more - is this an audit trail?
54
- solverParams:: Any # Solver parameters
61
+ solverParams:: T # Solver parameters
62
+ end
63
+
64
+ function GraphsDFG (g:: FGType ,
65
+ d:: String ,
66
+ n:: Int64 ,
67
+ l:: Dict{Symbol, Int64} ,
68
+ a:: Vector{Symbol} ,
69
+ s:: T = InMemoryParams (999999999 , false )) where T <: SolverParams
70
+ #
71
+ GraphsDFG {T} (g, d, n, l, a, s)
55
72
end
56
73
57
74
"""
58
75
$(SIGNATURES)
59
76
Create a new in-memory Graphs.jl-based DFG factor graph.
60
77
"""
61
- GraphsDFG () = GraphsDFG (Graphs. incdict (GraphsNode,is_directed= false ), " Graphs.jl implementation" , 0 , Dict {Symbol, Int64} (), Symbol[], nothing )
78
+ GraphsDFG () = GraphsDFG (Graphs. incdict (GraphsNode,is_directed= false ), " Graphs.jl implementation" , 0 , Dict {Symbol, Int64} (), Symbol[])
62
79
63
80
# Accessors
64
81
getLabelDict (dfg:: GraphsDFG ) = dfg. labelDict
0 commit comments