21 #include <gtsam/inference/FactorGraph-inst.h>
24 #include <boost/foreach.hpp>
30 template<
class CONDITIONAL>
37 template<
class CONDITIONAL>
40 std::ofstream of(s.c_str());
43 BOOST_REVERSE_FOREACH(
const sharedConditional& conditional, *
this) {
44 typename CONDITIONAL::Frontals frontals = conditional->frontals();
46 typename CONDITIONAL::Parents parents = conditional->parents();
47 BOOST_FOREACH(
Key p, parents)
48 of << keyFormatter(p) << "->" << keyFormatter(me) << std::endl;
sharedFactor front() const
Get the first factor.
Definition: FactorGraph.h:295
A BayesNet is a tree of conditionals, stored in elimination order.
Definition: BayesNet.h:34
void print(const Matrix &A, const string &s, ostream &stream)
print a matrix
Definition: Matrix.cpp:183
void print(const std::string &s="BayesNet", const KeyFormatter &formatter=DefaultKeyFormatter) const
print out graph
Definition: BayesNet-inst.h:31
size_t Key
Integer nonlinear key type.
Definition: types.h:59
boost::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
Definition: types.h:62