Formatting only

release/4.3a0
dellaert 2015-06-21 12:57:26 -07:00
parent 67013cba05
commit 0d0a9e5b16
1 changed files with 105 additions and 104 deletions

View File

@ -13,19 +13,17 @@
#include <gtsam/base/FastVector.h>
#include <gtsam/inference/Ordering.h>
namespace gtsam
{
namespace gtsam {
/**
/**
* A cluster-tree is associated with a factor graph and is defined as in Koller-Friedman:
* each node k represents a subset \f$ C_k \sub X \f$, and the tree is family preserving, in that
* each factor \f$ f_i \f$ is associated with a single cluster and \f$ scope(f_i) \sub C_k \f$.
* \nosubgrouping
*/
template<class BAYESTREE, class GRAPH>
class ClusterTree
{
public:
template<class BAYESTREE, class GRAPH>
class ClusterTree {
public:
typedef GRAPH FactorGraphType; ///< The factor graph type
typedef typename GRAPH::FactorType FactorType; ///< The type of factors
typedef ClusterTree<BAYESTREE, GRAPH> This; ///< This class
@ -41,8 +39,10 @@ namespace gtsam
typedef FastVector<sharedFactor> Factors;
typedef FastVector<boost::shared_ptr<Cluster> > Children;
Cluster() {}
Cluster(Key key, const Factors& factors) : factors(factors) {
Cluster() {
}
Cluster(Key key, const Factors& factors) :
factors(factors) {
orderedFrontalKeys.push_back(key);
}
@ -51,10 +51,13 @@ namespace gtsam
Children children; ///< sub-trees
int problemSize_;
int problemSize() const { return problemSize_; }
int problemSize() const {
return problemSize_;
}
/** print this node */
void print(const std::string& s = "", const KeyFormatter& keyFormatter = DefaultKeyFormatter) const;
void print(const std::string& s = "", const KeyFormatter& keyFormatter =
DefaultKeyFormatter) const;
};
typedef boost::shared_ptr<Cluster> sharedCluster; ///< Shared pointer to Cluster
@ -64,7 +67,7 @@ namespace gtsam
/** concept check */
GTSAM_CONCEPT_TESTABLE_TYPE(FactorType);
protected:
protected:
FastVector<sharedNode> roots_;
FastVector<sharedFactor> remainingFactors_;
@ -73,11 +76,11 @@ namespace gtsam
/** Copy constructor - makes a deep copy of the tree structure, but only pointers to factors are
* copied, factors are not cloned. */
ClusterTree(const This& other) { *this = other; }
ClusterTree(const This& other) {*this = other;}
/// @}
public:
public:
/// @name Testable
/// @{
@ -103,14 +106,14 @@ namespace gtsam
/// @{
/** Return the set of roots (one for a tree, multiple for a forest) */
const FastVector<sharedNode>& roots() const { return roots_; }
const FastVector<sharedNode>& roots() const {return roots_;}
/** Return the remaining factors that are not pulled into elimination */
const FastVector<sharedFactor>& remainingFactors() const { return remainingFactors_; }
const FastVector<sharedFactor>& remainingFactors() const {return remainingFactors_;}
/// @}
protected:
protected:
/// @name Details
/// Assignment operator - makes a deep copy of the tree structure, but only pointers to factors
@ -122,9 +125,7 @@ namespace gtsam
/// @}
};
};
}