24 #include <boost/shared_ptr.hpp> 49 GTSAM_EXPORT
static double safe_div(
const double&
a,
const double&
b);
64 template<
class SOURCE>
66 ADT(keys, table), cardinalities_(keys.cardinalities()) {
70 GTSAM_EXPORT
bool equals(
const Potentials& other,
double tol = 1
e-9)
const;
71 GTSAM_EXPORT
void print(
const std::string&
s =
"Potentials: ",
AlgebraicDecisionTree< Key > ADT
Potentials(const ADT &potentials)
AlgebraicDecisionTree< Key > ADT
static const KeyFormatter DefaultKeyFormatter
Algebraic Decision Trees.
Potentials(const DiscreteKeys &keys, SOURCE table)
const KeyFormatter & formatter
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
Array< double, 1, 3 > e(1./3., 0.5, 2.)
size_t cardinality(Key j) const
specialized key for discrete variables
static GTSAM_EXPORT double safe_div(const double &a, const double &b)
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.
std::uint64_t Key
Integer nonlinear key type.
GTSAM_EXPORT Potentials()
DiscreteKeys is a set of keys that can be assembled using the & operator.