36 class DiscreteConditional;
68 const std::vector<double>&
table);
74 template <
class SOURCE>
94 const std::string&
s =
"DecisionTreeFactor:\n",
120 static double safe_div(
const double&
a,
const double&
b);
126 return apply(f, safe_div);
133 shared_ptr
sum(
size_t nrFrontals)
const {
143 shared_ptr
max(
size_t nrFrontals)
const {
169 shared_ptr combine(
size_t nrFrontals, ADT::Binary op)
const;
177 shared_ptr combine(
const Ordering&
keys, ADT::Binary op)
const;
180 std::vector<std::pair<DiscreteValues, double>> enumerate()
const;
210 void dot(std::ostream&
os,
212 bool showZero =
true)
const;
215 void dot(
const std::string&
name,
217 bool showZero =
true)
const;
221 bool showZero =
true)
const;
256 #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION 258 friend class boost::serialization::access;
259 template <
class ARCHIVE>
260 void serialize(ARCHIVE& ar,
const unsigned int ) {
261 ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base);
262 ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(ADT);
263 ar& BOOST_SERIALIZATION_NVP(cardinalities_);
void print(const Matrix &A, const string &s, ostream &stream)
const gtsam::Symbol key('X', 0)
DecisionTreeFactor operator*(const DecisionTreeFactor &f) const override
multiply two factors
const MATRIX::ConstRowXpr row(const MATRIX &A, size_t j)
double dot(const V1 &a, const V2 &b)
std::string serialize(const T &input)
serializes to a string
DecisionTreeFactor operator/(const DecisionTreeFactor &f) const
divide by factor f (safely)
double mul(const double &a, const double &b)
DecisionTree< L, Y > apply(const DecisionTree< L, Y > &f, const typename DecisionTree< L, Y >::Unary &op)
Apply unary operator op to DecisionTree f.
string markdown(const DiscreteValues &values, const KeyFormatter &keyFormatter, const DiscreteValues::Names &names)
Free version of markdown.
shared_ptr max(size_t nrFrontals) const
Create new factor by maximizing over all values with the same separator.
DecisionTreeFactor(const DiscreteKey &key, SOURCE table)
Single-key specialization.
static const KeyFormatter DefaultKeyFormatter
Algebraic Decision Trees.
const KeyFormatter & formatter
DecisionTreeFactor toDecisionTreeFactor() const override
Convert into a decisiontree.
string html(const DiscreteValues &values, const KeyFormatter &keyFormatter, const DiscreteValues::Names &names)
Free version of html.
double evaluate(const DiscreteValues &values) const
size_t cardinality(Key j) const
double operator()(const DiscreteValues &values) const override
Evaluate probability distribution, sugar.
std::map< Key, size_t > cardinalities_
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
DiscreteFactor Base
Typedef to base class.
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
DiscreteValues::Names Names
Translation table from values to strings.
specialized key for discrete variables
std::shared_ptr< DecisionTreeFactor > shared_ptr
ofstream os("timeSchurFactors.csv")
std::pair< Key, size_t > DiscreteKey
shared_ptr sum(size_t nrFrontals) const
Create new factor by summing all values with the same separator values.
graph add(PriorFactor< Pose2 >(1, priorMean, priorNoise))
shared_ptr max(const Ordering &keys) const
Create new factor by maximizing over all values with the same separator.
Annotation for function names.
shared_ptr sum(const Ordering &keys) const
Create new factor by summing all values with the same separator values.
internal::enable_if< internal::valid_indexed_view_overload< RowIndices, ColIndices >::value &&internal::traits< typename EIGEN_INDEXED_VIEW_METHOD_TYPE< RowIndices, ColIndices >::type >::ReturnAsIndexedView, typename EIGEN_INDEXED_VIEW_METHOD_TYPE< RowIndices, ColIndices >::type >::type operator()(const RowIndices &rowIndices, const ColIndices &colIndices) EIGEN_INDEXED_VIEW_METHOD_CONST
std::uint64_t Key
Integer nonlinear key type.
AlgebraicDecisionTree< Key > ADT
DecisionTreeFactor(const DiscreteKey &key, const std::vector< double > &row)
Single-key specialization, with vector of doubles.
DiscreteKeys is a set of keys that can be assembled using the & operator.