30 void DotWriter::graphPreamble(ostream*
os)
const {
32 *os <<
" size=\"" << figureWidthInches <<
"," << figureHeightInches
36 void DotWriter::digraphPreamble(ostream*
os)
const {
38 *os <<
" size=\"" << figureWidthInches <<
"," << figureHeightInches
43 const std::optional<Vector2>&
position,
46 *os <<
" var" << key <<
"[label=\"" << keyFormatter(key)
49 *os <<
", pos=\"" << position->x() <<
"," << position->y() <<
"!\"";
51 if (boxes.count(key)) {
57 void DotWriter::DrawFactor(
size_t i,
const std::optional<Vector2>&
position,
59 *os <<
" factor" << i <<
"[label=\"\", shape=point";
61 *os <<
", pos=\"" << position->x() <<
"," << position->y() <<
"!\"";
68 *os <<
" var" << key1 <<
"--" 69 <<
"var" << key2 <<
";\n";
73 size_t i, ostream*
os) {
74 *os <<
" var" << key <<
"--" 75 <<
"factor" << i <<
";\n";
79 std::optional<Vector2> DotWriter::variablePos(
Key key)
const {
80 std::optional<Vector2>
result = {};
84 auto hint = positionHints.find(symbol.
chr());
85 if (hint != positionHints.end()) {
90 auto pos = variablePositions.find(key);
91 if (pos != variablePositions.end()) {
100 const std::optional<Vector2>&
position,
102 if (plotFactorPoints) {
103 if (binaryEdges && keys.size() == 2) {
107 if (!position && factorPositions.count(i))
108 DrawFactor(i, factorPositions.at(i),
os);
110 DrawFactor(i, position, os);
113 if (connectKeysToFactor) {
const gtsam::Symbol key('X', 0)
const Symbol key1('v', 1)
Key symbol(unsigned char c, std::uint64_t j)
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
std::uint64_t index() const
typedef and functions to augment Eigen's VectorXd
unsigned char chr() const
ofstream os("timeSchurFactors.csv")
static void ConnectVariables(Key key1, Key key2, const KeyFormatter &keyFormatter, ostream *os)
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
Point3 position(const NavState &X, OptionalJacobian< 3, 9 > H)
std::uint64_t Key
Integer nonlinear key type.
static void ConnectVariableFactor(Key key, const KeyFormatter &keyFormatter, size_t i, ostream *os)
const Symbol key2('v', 2)