Go to the documentation of this file.
37 class DiscreteConditional;
88 const std::vector<double>&
table);
111 template <
class SOURCE>
120 explicit DecisionTreeFactor(
const DiscreteConditional&
c);
131 const std::string&
s =
"DecisionTreeFactor:\n",
145 using DiscreteFactor::operator();
155 static double safe_div(
const double&
a,
const double&
b);
159 return apply(
f, safe_div);
215 shared_ptr combine(
size_t nrFrontals, Binary op)
const;
223 shared_ptr combine(
const Ordering&
keys, Binary op)
const;
226 std::vector<std::pair<DiscreteValues, double>> enumerate()
const;
229 std::vector<double> probabilities()
const;
240 double computeThreshold(
const size_t N)
const;
267 void dot(std::ostream&
os,
269 bool showZero =
true)
const;
272 void dot(
const std::string&
name,
274 bool showZero =
true)
const;
278 bool showZero =
true)
const;
288 const Names&
names = {})
const override;
298 const Names&
names = {})
const override;
313 #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
315 friend class boost::serialization::access;
316 template <
class ARCHIVE>
317 void serialize(ARCHIVE& ar,
const unsigned int ) {
318 ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(
Base);
319 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
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
static double mul(const double &a, const double &b)
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.
static double max(const double &a, const double &b)
DecisionTreeFactor operator*(const DecisionTreeFactor &f) const override
multiply two factors
double dot(const V1 &a, const V2 &b)
virtual double evaluate(const Assignment< Key > &values) const override
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.
std::function< double(const double, const double)> Binary
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)
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
static double add(const double &a, const double &b)
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.
std::function< double(const Assignment< Key > &, const double &)> UnaryAssignment
std::function< double(const double &)> Unary
DecisionTreeFactor(const DiscreteKey &key, SOURCE table)
Single-key specialization.
gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:11:26