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",
94 return apply(f, safe_div);
103 shared_ptr
sum(
size_t nrFrontals)
const {
113 shared_ptr
max(
size_t nrFrontals)
const {
134 shared_ptr combine(
size_t nrFrontals,
ADT::Binary op)
const;
void print(const Matrix &A, const string &s, ostream &stream)
DecisionTreeFactor operator*(const DecisionTreeFactor &f) const override
multiply two factors
double mul(const double &a, const double &b)
DecisionTree< L, Y > apply(const DecisionTree< L, Y > &f, const typename DecisionTree< L, Y >::Unary &op)
shared_ptr sum(const Ordering &keys) const
Create new factor by summing all values with the same separator values.
boost::function< double(const double &, const double &)> Binary
double operator()(const Values &values) const override
Value is just look up in AlgebraicDecisonTree.
static const KeyFormatter DefaultKeyFormatter
const KeyFormatter & formatter
graph add(boost::make_shared< UnaryFactor >(1, 0.0, 0.0, unaryNoise))
DecisionTreeFactor toDecisionTreeFactor() const override
Convert into a decisiontree.
DecisionTreeFactor(const DiscreteKeys &keys, SOURCE table)
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
shared_ptr sum(size_t nrFrontals) const
Create new factor by summing all values with the same separator values.
DiscreteFactor Base
Typedef to base class.
DecisionTreeFactor operator/(const DecisionTreeFactor &f) const
divide by factor f (safely)
const double & operator()(const Assignment< Key > &x) const
boost::shared_ptr< DecisionTreeFactor > shared_ptr
shared_ptr max(size_t nrFrontals) const
Create new factor by maximizing over all values with the same separator values.
DiscreteKeys is a set of keys that can be assembled using the & operator.