2010-10-14 12:54:38 +08:00
|
|
|
/* ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
* 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
|
|
|
|
|
|
|
|
|
|
* -------------------------------------------------------------------------- */
|
|
|
|
|
|
2011-10-14 11:23:14 +08:00
|
|
|
/**
|
|
|
|
|
* @file JunctionTree.h
|
|
|
|
|
* @date Feb 4, 2010
|
2011-09-07 09:26:28 +08:00
|
|
|
* @author Kai Ni
|
|
|
|
|
* @author Frank Dellaert
|
2013-07-30 07:55:40 +08:00
|
|
|
* @author Richard Roberts
|
|
|
|
|
* @brief The junction tree
|
2010-07-08 05:41:50 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2013-10-10 01:39:19 +08:00
|
|
|
#include <gtsam/inference/ClusterTree.h>
|
2010-07-08 05:41:50 +08:00
|
|
|
|
|
|
|
|
namespace gtsam {
|
|
|
|
|
|
2013-11-06 00:06:10 +08:00
|
|
|
// Forward declarations
|
|
|
|
|
template<class BAYESNET, class GRAPH> class EliminationTree;
|
|
|
|
|
|
2012-10-02 22:40:07 +08:00
|
|
|
/**
|
2013-10-10 01:39:19 +08:00
|
|
|
* A JunctionTree is a ClusterTree, i.e., a set of variable clusters with factors, arranged
|
|
|
|
|
* in a tree, with the additional property that it represents the clique tree associated
|
|
|
|
|
* with a Bayes net.
|
2012-10-02 22:40:07 +08:00
|
|
|
*
|
|
|
|
|
* In GTSAM a junction tree is an intermediate data structure in multifrontal
|
|
|
|
|
* variable elimination. Each node is a cluster of factors, along with a
|
|
|
|
|
* clique of variables that are eliminated all at once. In detail, every node k represents
|
|
|
|
|
* a clique (maximal fully connected subset) of an associated chordal graph, such as a
|
|
|
|
|
* chordal Bayes net resulting from elimination.
|
|
|
|
|
*
|
|
|
|
|
* The difference with the BayesTree is that a JunctionTree stores factors, whereas a
|
|
|
|
|
* BayesTree stores conditionals, that are the product of eliminating the factors in the
|
|
|
|
|
* corresponding JunctionTree cliques.
|
|
|
|
|
*
|
|
|
|
|
* The tree structure and elimination method are exactly analagous to the EliminationTree,
|
|
|
|
|
* except that in the JunctionTree, at each node multiple variables are eliminated at a time.
|
|
|
|
|
*
|
|
|
|
|
* \addtogroup Multifrontal
|
|
|
|
|
* \nosubgrouping
|
|
|
|
|
*/
|
2013-07-30 07:55:40 +08:00
|
|
|
template<class BAYESTREE, class GRAPH>
|
2013-10-10 01:39:19 +08:00
|
|
|
class JunctionTree : public ClusterTree<BAYESTREE, GRAPH> {
|
2012-10-02 22:40:07 +08:00
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
2013-07-30 07:55:40 +08:00
|
|
|
typedef JunctionTree<BAYESTREE, GRAPH> This; ///< This class
|
|
|
|
|
typedef boost::shared_ptr<This> shared_ptr; ///< Shared pointer to this class
|
2013-10-10 01:39:19 +08:00
|
|
|
typedef ClusterTree<BAYESTREE, GRAPH> Base; ///< Our base class
|
2012-10-02 22:40:07 +08:00
|
|
|
|
2013-07-30 07:55:40 +08:00
|
|
|
protected:
|
2010-07-08 05:41:50 +08:00
|
|
|
|
2013-07-30 07:55:40 +08:00
|
|
|
/// @name Standard Constructors
|
|
|
|
|
/// @{
|
2010-07-08 05:41:50 +08:00
|
|
|
|
2013-07-30 07:55:40 +08:00
|
|
|
/** Build the junction tree from an elimination tree. */
|
|
|
|
|
template<class ETREE>
|
2013-08-27 23:53:30 +08:00
|
|
|
static This FromEliminationTree(const ETREE& eliminationTree) { return This(eliminationTree); }
|
|
|
|
|
|
|
|
|
|
/** Build the junction tree from an elimination tree. */
|
2013-11-06 00:06:10 +08:00
|
|
|
template<class ETREE_BAYESNET, class ETREE_GRAPH>
|
|
|
|
|
JunctionTree(const EliminationTree<ETREE_BAYESNET, ETREE_GRAPH>& eliminationTree);
|
2010-07-08 05:41:50 +08:00
|
|
|
|
2012-10-02 22:40:07 +08:00
|
|
|
/// @}
|
2012-01-24 03:54:45 +08:00
|
|
|
|
2013-07-30 07:55:40 +08:00
|
|
|
private:
|
|
|
|
|
|
|
|
|
|
// Private default constructor (used in static construction methods)
|
|
|
|
|
JunctionTree() {}
|
2010-07-08 05:41:50 +08:00
|
|
|
|
2013-07-30 07:55:40 +08:00
|
|
|
};
|
2011-12-13 07:19:31 +08:00
|
|
|
|
2013-10-10 01:39:19 +08:00
|
|
|
}
|