Go to the documentation of this file.
24 template <
class GRAPH>
56 template <
class CONTAINER>
63 template <
class CONTAINER>
66 factors.push_back(factorsToAdd);
71 void addChild(
const std::shared_ptr<Cluster>& cluster) {
93 virtual void print(
const std::string&
s =
"",
100 void merge(
const std::shared_ptr<Cluster>& cluster);
138 void print(
const std::string&
s =
"",
145 void addRoot(
const std::shared_ptr<Cluster>& cluster) {
146 roots_.push_back(cluster);
150 for (
auto child : cluster->children)
185 template <
class BAYESTREE,
class GRAPH>
186 class EliminatableClusterTree :
public ClusterTree<GRAPH> {
194 typedef std::shared_ptr<ConditionalType>
224 std::pair<std::shared_ptr<BayesTreeType>, std::shared_ptr<FactorGraphType> >
eliminate(
std::vector< size_t > nrFrontalsOfChildren() const
Return a vector with nrFrontal keys for each child.
std::shared_ptr< This > shared_ptr
Shared pointer to this class.
std::shared_ptr< FactorType > sharedFactor
Shared pointer to a factor.
size_t nrFrontals() const
const FastVector< sharedNode > & roots() const
A thin wrapper around std::vector that uses a custom allocator.
Concept check for values that can be used in unit tests.
void mergeChildren(const std::vector< bool > &merge)
Merge all children for which bit is set into this node.
std::shared_ptr< FactorType > sharedFactor
Shared pointer to a factor.
GRAPH FactorGraphType
The factor graph type.
std::vector< T, typename internal::FastDefaultVectorAllocator< T >::type > FastVector
ClusterTree< GRAPH > This
This class.
FactorGraphType factors
Factors associated with this node.
Keys orderedFrontalKeys
Frontal keys of this node.
EliminatableClusterTree(const This &other)
Variable ordering for the elimination algorithm.
GRAPH::FactorType FactorType
The type of factors.
void addFactors(Key key, const CONTAINER &factorsToAdd)
Add factors associated with a single key.
std::shared_ptr< ConditionalType > sharedConditional
Shared pointer to a conditional.
EliminatableClusterTree< BAYESTREE, GRAPH > This
This class.
ClusterTree()
Default constructor.
KeyFormatter DefaultKeyFormatter
Assign default key formatter.
Children children
sub-trees
void addRoot(const std::shared_ptr< Cluster > &cluster)
BAYESTREE BayesTreeType
The BayesTree type produced by elimination.
GRAPH FactorGraphType
The factor graph type.
virtual void print(const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const
print this node
EliminatableClusterTree()
Default constructor to be used in derived classes.
FastVector< sharedNode > roots_
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
const Cluster & operator[](size_t i) const
void print(const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const
Cluster(Key key, const CONTAINER &factorsToAdd)
Construct from factors associated with a single key.
const FastVector< sharedFactor > & remainingFactors() const
const gtsam::Symbol key('X', 0)
const Cluster & operator[](size_t i) const
GRAPH::Eliminate Eliminate
Typedef for an eliminate subroutine.
This & operator=(const This &other)
size_t nrChildren() const
A Cluster is just a collection of factors.
#define GTSAM_CONCEPT_TESTABLE_TYPE(T)
FastVector< sharedFactor > remainingFactors_
std::shared_ptr< Cluster > sharedCluster
Shared pointer to Cluster.
void merge(const std::shared_ptr< Cluster > &cluster)
Merge in given cluster.
FastVector< std::shared_ptr< Cluster > > Children
void addChildrenAsRoots(const std::shared_ptr< Cluster > &cluster)
std::pair< std::shared_ptr< BayesTreeType >, std::shared_ptr< FactorGraphType > > eliminate(const Eliminate &function) const
GRAPH::FactorType FactorType
The type of factors.
Collects factorgraph fragments defined on variable clusters, arranged in a tree.
std::shared_ptr< This > shared_ptr
Shared pointer to this class.
std::uint64_t Key
Integer nonlinear key type.
This & operator=(const This &other)
BAYESTREE::ConditionalType ConditionalType
The type of conditionals.
ClusterTree(const This &other)
void addChild(const std::shared_ptr< Cluster > &cluster)
Add a child cluster.
gtsam
Author(s):
autogenerated on Fri Nov 1 2024 03:32:06