21 #include <boost/format.hpp> 30 template class DecisionTree<Key, double>;
31 template class AlgebraicDecisionTree<Key>;
34 double Potentials::safe_div(
const double&
a,
const double&
b) {
39 return (a == 0 || b == 0) ? 0 : (a /
b);
44 Potentials::Potentials() :
ADT(1.0) {}
58 cout << s <<
"\n Cardinalities: {";
bool equals(const DecisionTree &other, double tol=1e-9) const
const KeyFormatter & formatter
void print(const std::string &s="DecisionTree") const
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
GTSAM_EXPORT bool equals(const Potentials &other, double tol=1e-9) const
GTSAM_EXPORT void print(const std::string &s="Potentials: ", const KeyFormatter &formatter=DefaultKeyFormatter) const
std::map< Key, size_t > cardinalities_
Cardinality for each key, used in combine.
GTSAM_EXPORT Potentials()
DiscreteKeys is a set of keys that can be assembled using the & operator.