/* ---------------------------------------------------------------------------- * GTSAM Copyright 2010, Georgia Tech Research Corporation, * Atlanta, Georgia 30332-0415 * All Rights Reserved * Authors: Frank Dellaert, et al. (see THANKS for the full author list) * See LICENSE for the license information * -------------------------------------------------------------------------- */ /** * @file DiscreteBayesTree.h * @brief Discrete Bayes Tree, the result of eliminating a * DiscreteJunctionTree * @brief DiscreteBayesTree * @author Frank Dellaert * @author Richard Roberts */ #pragma once #include #include #include #include #include #include namespace gtsam { // Forward declarations class DiscreteConditional; class VectorValues; /* ************************************************************************* */ /** A clique in a DiscreteBayesTree */ class GTSAM_EXPORT DiscreteBayesTreeClique : public BayesTreeCliqueBase { public: typedef DiscreteBayesTreeClique This; typedef BayesTreeCliqueBase Base; typedef boost::shared_ptr shared_ptr; typedef boost::weak_ptr weak_ptr; DiscreteBayesTreeClique() {} virtual ~DiscreteBayesTreeClique() {} DiscreteBayesTreeClique( const boost::shared_ptr& conditional) : Base(conditional) {} /// print index signature only void printSignature( const std::string& s = "Clique: ", const KeyFormatter& formatter = DefaultKeyFormatter) const { conditional_->printSignature(s, formatter); } //** evaluate conditional probability of subtree for given Values */ double evaluate(const DiscreteConditional::Values& values) const; }; /* ************************************************************************* */ /** A Bayes tree representing a Discrete density */ class GTSAM_EXPORT DiscreteBayesTree : public BayesTree { private: typedef BayesTree Base; public: typedef DiscreteBayesTree This; typedef boost::shared_ptr shared_ptr; /** Default constructor, creates an empty Bayes tree */ DiscreteBayesTree() {} /** Check equality */ bool equals(const This& other, double tol = 1e-9) const; //** evaluate probability for given Values */ double evaluate(const DiscreteConditional::Values& values) const; }; } // namespace gtsam