42 void print(
const std::string&
s =
"")
const ;
63 template<
class CLIQUE>
115 This& operator=(
const This& other);
121 bool equals(
const This& other,
double tol = 1
e-9)
const;
125 void print(
const std::string&
s =
"",
137 return nodes_.empty();
141 const Nodes&
nodes()
const {
return nodes_; }
147 const Roots&
roots()
const {
return roots_; }
151 typename Nodes::const_iterator
c = nodes_.find(j);
152 if(c == nodes_.end())
153 throw std::out_of_range(
"Requested the BayesTree clique for a key that is not in the BayesTree");
162 size_t numCachedSeparatorMarginals()
const;
169 sharedConditional marginalFactor(
Key j,
const Eliminate&
function = EliminationTraitsType::DefaultEliminate)
const;
175 sharedFactorGraph joint(
Key j1,
Key j2,
const Eliminate&
function = EliminationTraitsType::DefaultEliminate)
const;
181 sharedBayesNet jointBayesNet(
Key j1,
Key j2,
const Eliminate&
function = EliminationTraitsType::DefaultEliminate)
const;
198 template<
class CONTAINER>
199 Key findParentClique(
const CONTAINER& parents)
const;
205 void deleteCachedShortcuts();
211 void removePath(sharedClique clique, BayesNetType* bn, Cliques* orphans);
217 void removeTop(
const KeyVector&
keys, BayesNetType* bn, Cliques* orphans);
221 Cliques removeSubtree(
const sharedClique& subtree);
226 void insertRoot(
const sharedClique& subtree);
229 void addClique(
const sharedClique& clique,
const sharedClique& parent_clique = sharedClique());
237 void saveGraph(std::ostream &s, sharedClique clique,
const KeyFormatter& keyFormatter,
238 int parentnum = 0)
const;
244 void removeClique(sharedClique clique);
247 void fillNodesIndex(
const sharedClique& subtree);
254 friend class boost::serialization::access;
255 template<
class ARCHIVE>
257 ar & BOOST_SERIALIZATION_NVP(nodes_);
258 ar & BOOST_SERIALIZATION_NVP(roots_);
266 template<
class CLIQUE>
271 typedef typename CLIQUE::ConditionalType
Base;
280 this->keys_.assign(clique->conditional()->beginParents(), clique->conditional()->endParents());
284 clique->print(
s +
"stored clique",
formatter);
void print(const Matrix &A, const string &s, ostream &stream)
const sharedNode operator[](Key j) const
boost::shared_ptr< Clique > sharedClique
Shared pointer to a clique.
FactorGraphType::Eliminate Eliminate
sharedClique sharedNode
Synonym for sharedClique (TODO: remove)
A thin wrapper around std::list that uses boost's fast_pool_allocator.
std::size_t maxSeparatorSize
void print(const std::string &s="", const KeyFormatter &formatter=DefaultKeyFormatter) const override
const Nodes & nodes() const
CLIQUE::ConditionalType Base
NonlinearFactorGraph graph
static const KeyFormatter DefaultKeyFormatter
Clique Node
Synonym for Clique (TODO: remove)
const KeyFormatter & formatter
CLIQUE::EliminationTraitsType EliminationTraitsType
const sharedClique & clique(Key j) const
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
FastVector< std::size_t > conditionalSizes
CLIQUE Clique
The clique type, normally BayesTreeClique.
CLIQUE::ConditionalType ConditionalType
double avgConditionalSize
FastVector< std::size_t > separatorSizes
BayesTreeOrphanWrapper(const boost::shared_ptr< CliqueType > &clique)
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
ConcurrentMap< Key, sharedClique > Nodes
Array< double, 1, 3 > e(1./3., 0.5, 2.)
boost::shared_ptr< FactorType > sharedFactor
boost::shared_ptr< CliqueType > clique
CLIQUE::FactorGraphType FactorGraphType
A thin wrapper around std::vector that uses a custom allocator.
boost::shared_ptr< This > shared_ptr
boost::shared_ptr< FactorGraphType > sharedFactorGraph
boost::shared_ptr< BayesNetType > sharedBayesNet
void serialize(ARCHIVE &ar, const unsigned int)
boost::function< EliminationResult(const FactorGraphType &, const Ordering &)> Eliminate
The function type that does a single dense elimination step on a subgraph.
std::vector< T, typename internal::FastDefaultVectorAllocator< T >::type > FastVector
FastList< sharedClique > Cliques
FastVector< sharedClique > Roots
CLIQUE::BayesNetType BayesNetType
boost::shared_ptr< ConditionalType > sharedConditional
std::size_t maxConditionalSize
const Roots & roots() const
std::uint64_t Key
Integer nonlinear key type.
CLIQUE::FactorType FactorType