diff --git a/gtsam/inference/BayesTree.h b/gtsam/inference/BayesTree.h index 03f79c8cf..4a2ae7560 100644 --- a/gtsam/inference/BayesTree.h +++ b/gtsam/inference/BayesTree.h @@ -119,13 +119,14 @@ namespace gtsam { /** Assignment operator */ This& operator=(const This& other); + public: + /// @name Testable /// @{ /** check equality */ bool equals(const This& other, double tol = 1e-9) const; - public: /** print */ void print(const std::string& s = "", const KeyFormatter& keyFormatter = DefaultKeyFormatter) const; @@ -185,18 +186,19 @@ namespace gtsam { */ sharedBayesNet jointBayesNet(Key j1, Key j2, const Eliminate& function = EliminationTraitsType::DefaultEliminate) const; - /// @name Graph Display - /// @{ + /// @} + /// @name Graph Display + /// @{ - /// Output to graphviz format, stream version. - void dot(std::ostream& os, const KeyFormatter& keyFormatter = DefaultKeyFormatter) const; + /// Output to graphviz format, stream version. + void dot(std::ostream& os, const KeyFormatter& keyFormatter = DefaultKeyFormatter) const; - /// Output to graphviz format string. - std::string dot( - const KeyFormatter& keyFormatter = DefaultKeyFormatter) const; + /// Output to graphviz format string. + std::string dot( + const KeyFormatter& keyFormatter = DefaultKeyFormatter) const; - /// output to file with graphviz format. - void saveGraph(const std::string& filename, + /// output to file with graphviz format. + void saveGraph(const std::string& filename, const KeyFormatter& keyFormatter = DefaultKeyFormatter) const; /// @} diff --git a/gtsam/inference/BayesTreeCliqueBase-inst.h b/gtsam/inference/BayesTreeCliqueBase-inst.h index a91fa4f78..d335e4b5e 100644 --- a/gtsam/inference/BayesTreeCliqueBase-inst.h +++ b/gtsam/inference/BayesTreeCliqueBase-inst.h @@ -104,14 +104,16 @@ namespace gtsam { } /* ************************************************************************* */ - // The shortcut density is a conditional P(S|R) of the separator of this - // clique on the root. We can compute it recursively from the parent shortcut - // P(Sp|R) as \int P(Fp|Sp) P(Sp|R), where Fp are the frontal nodes in p - /* ************************************************************************* */ - template + // The shortcut density is a conditional P(S|B) of the separator of this + // clique on the root or common ancestor B. We can compute it recursively from + // the parent shortcut P(Sp|B) as \int P(Fp|Sp) P(Sp|B), where Fp are the + // frontal nodes in p + /* ************************************************************************* + */ + template typename BayesTreeCliqueBase::BayesNetType - BayesTreeCliqueBase::shortcut(const derived_ptr& B, Eliminate function) const - { + BayesTreeCliqueBase::shortcut( + const derived_ptr& B, Eliminate function) const { gttic(BayesTreeCliqueBase_shortcut); // We only calculate the shortcut when this clique is not B // and when the S\B is not empty diff --git a/gtsam/inference/BayesTreeCliqueBase.h b/gtsam/inference/BayesTreeCliqueBase.h index 0ccb04e90..c674fb13a 100644 --- a/gtsam/inference/BayesTreeCliqueBase.h +++ b/gtsam/inference/BayesTreeCliqueBase.h @@ -190,11 +190,11 @@ namespace gtsam { friend class BayesTree; - protected: - /// Calculate set \f$ S \setminus B \f$ for shortcut calculations KeyVector separator_setminus_B(const derived_ptr& B) const; + protected: + /** Determine variable indices to keep in recursive separator shortcut calculation The factor * graph p_Cp_B has keys from the parent clique Cp and from B. But we only keep the variables * not in S union B. */