25#include <boost/shared_ptr.hpp>
33 class DiscreteConditional;
45 typedef boost::shared_ptr<DecisionTreeFactor> shared_ptr;
59 template<
class SOURCE>
75 void print(
const std::string& s =
"DecisionTreeFactor:\n",
76 const KeyFormatter& formatter = DefaultKeyFormatter)
const override;
89 return apply(f, ADT::Ring::mul);
94 return apply(f, safe_div);
103 shared_ptr
sum(
size_t nrFrontals)
const {
104 return combine(nrFrontals, ADT::Ring::add);
109 return combine(keys, ADT::Ring::add);
113 shared_ptr
max(
size_t nrFrontals)
const {
114 return combine(nrFrontals, ADT::Ring::max);
134 shared_ptr combine(
size_t nrFrontals, ADT::Binary op)
const;
142 shared_ptr combine(
const Ordering& keys, ADT::Binary op)
const;
Variable ordering for the elimination algorithm.
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition: Matrix.cpp:155
DecisionTree< L, Y > apply(const DecisionTree< L, Y > &f, const typename DecisionTree< L, Y >::Unary &op)
free versions of apply
Definition: DecisionTree.h:218
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
Definition: Key.h:35
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition: concepts.h:30
Template to create a binary predicate.
Definition: Testable.h:111
A helper that implements the traits interface for GTSAM types.
Definition: Testable.h:151
An assignment from labels to value index (size_t).
Definition: Assignment.h:34
const double & operator()(const Assignment< Key > &x) const
evaluate
Definition: DecisionTree-inl.h:619
A discrete probabilistic factor.
Definition: DecisionTreeFactor.h:38
DecisionTreeFactor(const DiscreteKeys &keys, SOURCE table)
Constructor from Indices and (string or doubles)
Definition: DecisionTreeFactor.h:60
shared_ptr sum(const Ordering &keys) const
Create new factor by summing all values with the same separator values.
Definition: DecisionTreeFactor.h:108
DecisionTreeFactor operator*(const DecisionTreeFactor &f) const override
multiply two factors
Definition: DecisionTreeFactor.h:88
shared_ptr max(size_t nrFrontals) const
Create new factor by maximizing over all values with the same separator values.
Definition: DecisionTreeFactor.h:113
double operator()(const Values &values) const override
Value is just look up in AlgebraicDecisonTree.
Definition: DecisionTreeFactor.h:83
DiscreteFactor Base
Typedef to base class.
Definition: DecisionTreeFactor.h:44
shared_ptr sum(size_t nrFrontals) const
Create new factor by summing all values with the same separator values.
Definition: DecisionTreeFactor.h:103
DecisionTreeFactor toDecisionTreeFactor() const override
Convert into a decisiontree.
Definition: DecisionTreeFactor.h:98
DecisionTreeFactor operator/(const DecisionTreeFactor &f) const
divide by factor f (safely)
Definition: DecisionTreeFactor.h:93
Discrete Conditional Density Derives from DecisionTreeFactor.
Definition: DiscreteConditional.h:36
Base class for discrete probabilistic factors The most general one is the derived DecisionTreeFactor.
Definition: DiscreteFactor.h:34
DiscreteKeys is a set of keys that can be assembled using the & operator.
Definition: DiscreteKey.h:37
A base class for both DiscreteFactor and DiscreteConditional.
Definition: Potentials.h:32
Definition: Ordering.h:34