3
3
# Into, Labels, Subgraph are all implied from the parameters.
4
4
# can alies names but like Sam suggested only on copy is needed.
5
5
6
+
6
7
"""
7
8
$SIGNATURES
8
9
Construct a new factor graph object as a subgraph of `dfg <: AbstractDFG` based on the
@@ -62,24 +63,8 @@ function buildSubgraphFromLabels!(dfg::G,
62
63
return subfg
63
64
end
64
65
65
- """
66
- $SIGNATURES
67
66
68
- Display and return to console the user factor identified by tag name.
69
- """
70
- printFactor (fgl:: AbstractDFG , fsym:: Symbol ) = @show getFactor (fgl,fsym)
71
-
72
-
73
- """
74
- $SIGNATURES
75
-
76
- Display the content of `VariableNodeData` to console for a given factor graph and variable tag`::Symbol`.
77
-
78
- Dev Notes
79
- - TODO split as two show macros between AMP and DFG
80
- """
81
- function printVariable (fgl:: AbstractDFG , vsym:: Symbol , solveKey:: Symbol = :default )
82
- vert = getVariable (fgl, vsym)
67
+ function print (vert:: DFGVariable , solveKey:: Symbol = :default )
83
68
vnd = getSolverData (vert, solveKey)
84
69
println (" label: $(vert. label) " )
85
70
println (" tags: $(getTags (vert)) " )
@@ -96,6 +81,29 @@ function printVariable(fgl::AbstractDFG, vsym::Symbol, solveKey::Symbol=:default
96
81
vnd
97
82
end
98
83
84
+ print (fct:: DFGFactor ) = @show fct
85
+
86
+
87
+ """
88
+ $SIGNATURES
89
+
90
+ Display and return to console the user factor identified by tag name.
91
+ """
92
+ printFactor (fgl:: AbstractDFG , fsym:: Symbol ) = print (getFactor (dfg, sym))
93
+
94
+ """
95
+ $SIGNATURES
96
+
97
+ Display the content of `VariableNodeData` to console for a given factor graph and variable tag`::Symbol`.
98
+
99
+ Dev Notes
100
+ - TODO split as two show macros between AMP and DFG
101
+ """
102
+ printVariable (fgl:: AbstractDFG , vsym:: Symbol , solveKey:: Symbol = :default ) = print (getVariable (dfg, sym))
103
+
104
+ print (fgl:: AbstractDFG , fsym:: Symbol ) = isVariable (dfg,fsym) ? printVariable (dfg, fsym) : printFactor (dfg, sym)
105
+
106
+
99
107
# # KEEPING COMMENT, WANT TO BE CONSOLIDATED WITH FUNCTION ABOVE -- KEEPING ONLY ONE FOR MAINTAINABILITY
100
108
# # STILL NEEDS TO BE CONSOLIDATED WITH `DFG._copyIntoGraph`
101
109
# """
0 commit comments