@@ -31,19 +31,22 @@ export
31
31
filter_vertices,
32
32
reverse
33
33
34
- import DistributedFactorGraphs: DFGNode
35
- const AbstractNodeType = DFGNode
34
+ # import DistributedFactorGraphs: DFGNode
35
+ # const AbstractNodeType = DFGNode
36
+ import DistributedFactorGraphs: AbstractDFGVariable, AbstractDFGFactor
37
+ const AbstractVariableType = AbstractDFGVariable
38
+ const AbstractFactorType = AbstractDFGFactor
36
39
37
40
include (" BiMaps.jl" )
38
41
39
- struct FactorGraph{T <: Integer ,V <: AbstractNodeType , F <: AbstractNodeType } <: AbstractGraph{T}
42
+ struct FactorGraph{T <: Integer ,V <: AbstractVariableType , F <: AbstractFactorType } <: AbstractGraph{T}
40
43
graph:: SimpleGraph{T}
41
44
labels:: BiDictMap{T}
42
45
variables:: Dict{Symbol,V}
43
46
factors:: Dict{Symbol,F}
44
47
end
45
48
46
- function FactorGraph {T, V, F} (nv:: Int = 100 , nf:: Int = 100 ) where {T <: Integer , V <: AbstractNodeType , F <: AbstractNodeType }
49
+ function FactorGraph {T, V, F} (nv:: Int = 100 , nf:: Int = 100 ) where {T <: Integer , V <: AbstractVariableType , F <: AbstractFactorType }
47
50
fadjlist = Vector {Vector{T}} ()
48
51
sizehint! (fadjlist, nv + nf)
49
52
g = SimpleGraph {T} (0 , fadjlist)
@@ -55,10 +58,10 @@ function FactorGraph{T, V, F}(nv::Int=100, nf::Int=100) where {T <: Integer, V <
55
58
return FactorGraph {T, V, F} (g, labels, variables, factors)
56
59
end
57
60
58
- # fg = FactorGraph{Int, AbstractNodeType, AbstractNodeType }()
61
+ # fg = FactorGraph{Int, AbstractVariableType, AbstractFactorType }()
59
62
60
- FactorGraph () = FactorGraph {Int, AbstractNodeType, AbstractNodeType } ()
61
- FactorGraph {V,F} () where {V <: AbstractNodeType , F <: AbstractNodeType } = FactorGraph {Int, V, F} ()
63
+ FactorGraph () = FactorGraph {Int, AbstractVariableType, AbstractFactorType } ()
64
+ FactorGraph {V,F} () where {V <: AbstractVariableType , F <: AbstractFactorType } = FactorGraph {Int, V, F} ()
62
65
63
66
64
67
function show (io:: IO , g:: FactorGraph )
0 commit comments