21 #include <gtsam/inference/FactorGraph-inst.h> 24 #include <boost/range/adaptor/reversed.hpp> 30 template<
class CONDITIONAL>
37 template<
class CONDITIONAL>
40 std::ofstream of(s.c_str());
43 for (
auto conditional: boost::adaptors::reverse(*
this)) {
44 typename CONDITIONAL::Frontals frontals = conditional->frontals();
46 typename CONDITIONAL::Parents parents = conditional->parents();
48 of << keyFormatter(p) <<
"->" << keyFormatter(me) << std::endl;
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition: Matrix.cpp:141
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:57
sharedFactor front() const
Get the first factor.
Definition: FactorGraph.h:307
boost::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
Definition: Key.h:33
A BayesNet is a tree of conditionals, stored in elimination order.
Definition: BayesNet.h:34
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
void print(const std::string &s="BayesNet", const KeyFormatter &formatter=DefaultKeyFormatter) const
print out graph
Definition: BayesNet-inst.h:31