29 template class BayesTreeCliqueBase<DiscreteBayesTreeClique, DiscreteFactorGraph>;
30 template class BayesTree<DiscreteBayesTreeClique>;
38 result *= child->evaluate(values);
52 for (
const auto& root : roots_) {
53 result *= root->evaluate(values);
64 ss <<
"`DiscreteBayesTree` of size " << nodes_.size() << endl << endl;
67 ss <<
"\n" << clique->conditional()->markdown(keyFormatter, names);
81 ss <<
"<div><p><tt>DiscreteBayesTree</tt> of size " << nodes_.size()
85 ss << clique->conditional()->html(keyFormatter, names);
std::shared_ptr< This > shared_ptr
A Bayes tree representing a Discrete distribution.
Base class for cliques of a BayesTree.
bool equals(const DiscreteBayesTreeClique &other, double tol=1e-9) const
void DepthFirstForest(FOREST &forest, DATA &rootData, VISITOR_PRE &visitorPre, VISITOR_POST &visitorPost)
std::string html(const KeyFormatter &keyFormatter=DefaultKeyFormatter, const DiscreteFactor::Names &names={}) const
Render as html tables.
Discrete Bayes Tree, the result of eliminating a DiscreteJunctionTree.
FastVector< derived_ptr > children
Bayes Tree is a tree of cliques of a Bayes Chain.
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
bool equals(const This &other, double tol=1e-9) const
static std::stringstream ss
double evaluate(const DiscreteValues &values) const
DiscreteValues::Names Names
Translation table from values to strings.
double evaluate(const DiscreteValues &values) const
std::string markdown(const KeyFormatter &keyFormatter=DefaultKeyFormatter, const DiscreteFactor::Names &names={}) const
Render as markdown tables.