28 #include <type_traits>
31 using namespace gtsam;
86 NodeClique(Keys(
X(2))(
X(3)), 2,
90 Keys(
X(5))(
L(2))(
X(4)), 2,
91 Children(LeafClique(Keys(
L(3))(
X(4))(
X(5)), 1))))))(
92 LeafClique(Keys(
X(1))(
L(1))(
X(2)), 2))));
113 auto left = NodeClique(Keys(
_C_)(
_A_), 1, {LeafClique(Keys(_D_)(
_C_), 1)});
114 auto right = NodeClique(Keys(_E_)(
_B_), 1, {LeafClique(Keys(_F_)(_E_), 1)});
124 SymbolicBayesTree::Cliques expectedOrphans{bayesTree[_D_], bayesTree[_E_]};
127 SymbolicBayesTree::Cliques orphans;
133 bayesTree = bayesTreeOrig;
139 SymbolicBayesTree::Cliques expectedOrphans2{bayesTree[_F_], bayesTree[
_C_]};
142 SymbolicBayesTree::Cliques orphans2;
143 bayesTree.
removePath(bayesTree[_E_], &bn2, &orphans2);
155 SymbolicBayesTree::Cliques orphans;
163 SymbolicBayesTree::Cliques expectedOrphans{bayesTree[_S_], bayesTree[_T_],
174 SymbolicBayesTree::Cliques orphans;
175 bayesTree.
removePath(bayesTree[_T_], &bn, &orphans);
183 SymbolicBayesTree::Cliques expectedOrphans{bayesTree[_S_], bayesTree[_X_]};
188 SymbolicBayesTree::Cliques& cliques) {
191 cliques.push_back(subtree);
193 for (SymbolicBayesTree::sharedClique& childClique : subtree->children) {
201 const Key _A_ = 6,
_B_ = 5,
_C_ = 4, _D_ = 3, _E_ = 2, _F_ = 1, _G_ = 0;
214 SymbolicBayesTree::sharedClique rootClique = bayesTree.
roots().front();
216 SymbolicBayesTree::Cliques allCliques;
219 for (SymbolicBayesTree::sharedClique& clique : allCliques) {
227 rootClique->deleteCachedShortcuts();
228 for (SymbolicBayesTree::sharedClique& clique : allCliques) {
229 bool notCleared = clique->cachedSeparatorMarginal().has_value();
230 CHECK(notCleared ==
false);
255 SymbolicBayesTree::Cliques orphans;
260 expected.add(SymbolicConditional::FromKeys<KeyVector>(Keys(_E_)(
_L_)(
_B_), 3));
261 expected.add(SymbolicConditional::FromKeys<KeyVector>(Keys(_S_)(
_B_)(
_L_), 1));
264 SymbolicBayesTree::Cliques expectedOrphans{bayesTree[_T_], bayesTree[_X_]};
270 SymbolicBayesTree::Cliques orphans2;
275 SymbolicBayesTree::Cliques expectedOrphans2;
290 SymbolicBayesTree::Cliques orphans;
291 bayesTree.
removeTop(Keys(_T_), &bn, &orphans);
295 SymbolicConditional::FromKeys<KeyVector>(Keys(_E_)(
_L_)(
_B_), 3))(
296 SymbolicConditional::FromKeys<KeyVector>(Keys(_T_)(_E_)(
_L_), 1));
299 SymbolicBayesTree::Cliques expectedOrphans{bayesTree[_S_], bayesTree[_X_]};
312 SymbolicBayesTree::Cliques orphans;
313 bayesTree.
removeTop(Keys(
L(5))(
X(4))(
X(2))(
X(3)), &bn, &orphans);
316 SymbolicConditional::FromKeys<KeyVector>(Keys(
X(4))(
L(5)), 2))(
331 SymbolicBayesTree::Cliques orphans;
332 bayesTree.
removeTop(Keys(
X(2))(
L(5))(
X(4))(
X(3)), &bn, &orphans);
335 SymbolicConditional::FromKeys<KeyVector>(Keys(
X(4))(
L(5)), 2))(
351 SymbolicBayesTree::Cliques orphans;
352 bayesTree.
removeTop(Keys(
X(10)), &bn, &orphans);
393 bayesTree.
saveGraph(
"/tmp/SymbolicBayesTree.dot");
483 sharedClique root1 = LeafClique(Keys(1), 1);
484 sharedClique root2 = LeafClique(Keys(2), 1);
531 bayesTree.
saveGraph(
"/tmp/SymbolicBayesTree.dot");
569 sharedClique root = LeafClique(Keys(11)(12), 2);
572 root->children.push_back(LeafClique(Keys(9)(10)(11)(12), 2));
573 root->children.back()->parent_ = root;
575 root->children.push_back(LeafClique(Keys(7)(8)(11), 2));
576 root->children.back()->parent_ = root;
577 cur = root->children.back();
579 cur->children.push_back(LeafClique(Keys(5)(6)(7)(8), 2));
580 cur->children.back()->parent_ = cur;
581 cur = cur->children.back();
583 cur->children.push_back(LeafClique(Keys(3)(4)(6), 2));
584 cur->children.back()->parent_ = cur;
586 cur->children.push_back(LeafClique(Keys(1)(2)(5), 2));
587 cur->children.back()->parent_ = cur;
594 bt.
saveGraph(
"/tmp/SymbolicBayesTree.dot");
677 NodeClique(Keys(5)(1)(4), 1,
679 LeafClique(Keys(0)(1)(5), 1))))))));
685 #ifdef GTSAM_SUPPORT_NESTED_DISSECTION
690 #if defined(__APPLE__)
692 #elif defined(_WIN32)
703 #if defined(__APPLE__)
705 NodeClique(Keys(1)(0)(3), 3,
707 NodeClique(Keys(4)(0)(3), 1,
708 {LeafClique(Keys(5)(0)(4), 1)}))(
709 LeafClique(Keys(2)(1)(3), 1))));
710 #elif defined(_WIN32)
712 NodeClique(Keys(3)(5)(2), 3,
714 NodeClique(Keys(4)(3)(5), 1,
715 {LeafClique(Keys(0)(2)(5), 1)}))(
716 LeafClique(Keys(1)(0)(2), 1))));
719 NodeClique(Keys(2)(4)(1), 3,
721 NodeClique(Keys(0)(1)(4), 1,
722 {LeafClique(Keys(5)(0)(4), 1)}))(
723 LeafClique(Keys(3)(2)(4), 1))));