Go to the documentation of this file.
36 class DiscreteConditional;
82 const std::vector<double>&
table);
105 template <
class SOURCE>
114 explicit DecisionTreeFactor(
const DiscreteConditional&
c);
125 const std::string&
s =
"DecisionTreeFactor:\n",
151 static double safe_div(
const double&
a,
const double&
b);
155 return apply(
f, safe_div);
211 shared_ptr combine(
size_t nrFrontals, ADT::Binary op)
const;
219 shared_ptr combine(
const Ordering&
keys, ADT::Binary op)
const;
222 std::vector<std::pair<DiscreteValues, double>> enumerate()
const;
225 std::vector<double> probabilities()
const;
252 void dot(std::ostream&
os,
254 bool showZero =
true)
const;
257 void dot(
const std::string&
name,
259 bool showZero =
true)
const;
263 bool showZero =
true)
const;
273 const Names&
names = {})
const override;
283 const Names&
names = {})
const override;
298 #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
300 friend class boost::serialization::access;
301 template <
class ARCHIVE>
302 void serialize(ARCHIVE& ar,
const unsigned int ) {
303 ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(
Base);
304 ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(
ADT);
string markdown(const DiscreteValues &values, const KeyFormatter &keyFormatter, const DiscreteValues::Names &names)
Free version of markdown.
Annotation for function names.
DecisionTreeFactor toDecisionTreeFactor() const override
Convert into a decision tree.
Array< double, 1, 3 > e(1./3., 0.5, 2.)
const KeyFormatter & formatter
double mul(const double &a, const double &b)
Variable ordering for the elimination algorithm.
DiscreteKeys is a set of keys that can be assembled using the & operator.
ofstream os("timeSchurFactors.csv")
std::shared_ptr< DecisionTreeFactor > shared_ptr
KeyFormatter DefaultKeyFormatter
Assign default key formatter.
DecisionTreeFactor(const DiscreteKey &key, const std::vector< double > &row)
Single-key specialization, with vector of doubles.
Algebraic Decision Trees.
void print(const Matrix &A, const string &s, ostream &stream)
DiscreteFactor Base
Typedef to base class.
shared_ptr sum(const Ordering &keys) const
Create new factor by summing all values with the same separator values.
AlgebraicDecisionTree< Key > ADT
const MATRIX::ConstRowXpr row(const MATRIX &A, size_t j)
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::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
double operator()(const DiscreteValues &values) const override
Evaluate probability distribution, sugar.
graph add(PriorFactor< Pose2 >(1, priorMean, priorNoise))
DecisionTreeFactor operator*(const DecisionTreeFactor &f) const override
multiply two factors
double dot(const V1 &a, const V2 &b)
DecisionTreeFactor operator/(const DecisionTreeFactor &f) const
divide by factor f (safely)
shared_ptr sum(size_t nrFrontals) const
Create new factor by summing all values with the same separator values.
shared_ptr max(const Ordering &keys) const
Create new factor by maximizing over all values with the same separator.
specialized key for discrete variables
const gtsam::Symbol key('X', 0)
double evaluate(const Assignment< Key > &values) const
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
std::pair< Key, size_t > DiscreteKey
shared_ptr max(size_t nrFrontals) const
Create new factor by maximizing over all values with the same separator.
DecisionTree< L, Y > apply(const DecisionTree< L, Y > &f, const typename DecisionTree< L, Y >::Unary &op)
Apply unary operator op to DecisionTree f.
AlgebraicDecisionTree< Key > ADT
string html(const DiscreteValues &values, const KeyFormatter &keyFormatter, const DiscreteValues::Names &names)
Free version of html.
DecisionTreeFactor(const DiscreteKey &key, SOURCE table)
Single-key specialization.
gtsam
Author(s):
autogenerated on Fri Nov 1 2024 03:32:23