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();
172 static double safe_div(
const double&
a,
const double&
b);
184 return apply(
f, safe_div);
244 shared_ptr combine(
size_t nrFrontals, Binary op)
const;
252 shared_ptr combine(
const Ordering&
keys, Binary op)
const;
255 std::vector<std::pair<DiscreteValues, double>> enumerate()
const;
258 std::vector<double> probabilities()
const;
269 double computeThreshold(
const size_t N)
const;
302 void dot(std::ostream&
os,
304 bool showZero =
true)
const;
307 void dot(
const std::string&
name,
309 bool showZero =
true)
const;
313 bool showZero =
true)
const;
323 const Names&
names = {})
const override;
333 const Names&
names = {})
const override;
348 #if GTSAM_ENABLE_BOOST_SERIALIZATION
350 friend class boost::serialization::access;
351 template <
class ARCHIVE>
352 void serialize(ARCHIVE& ar,
const unsigned int ) {
353 ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(
Base);
354 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
DiscreteFactor::shared_ptr max(const Ordering &keys) const override
Create new factor by maximizing over all values with the same separator.
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.
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). Division of a factor by another factor results in a function which inv...
std::function< double(const double, const double)> Binary
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::shared_ptr< DiscreteFactor > shared_ptr
shared_ptr to this class
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE CwiseBinaryOp< internal::scalar_quotient_op< Scalar, typename OtherDerived::Scalar >, const Derived, const OtherDerived > operator/(const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &other) const
std::pair< Key, size_t > DiscreteKey
DecisionTree< L, Y > apply(const DecisionTree< L, Y > &f, const typename DecisionTree< L, Y >::Unary &op)
Apply unary operator op to DecisionTree f.
DiscreteFactor::shared_ptr sum(size_t nrFrontals) const override
Create new factor by summing all values with the same separator values.
DiscreteFactor::shared_ptr max(size_t nrFrontals) const override
Create new factor by maximizing over all values with the same separator.
unsigned __int64 uint64_t
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
uint64_t nrValues() const override
DecisionTreeFactor(const DiscreteKey &key, SOURCE table)
Single-key specialization.
DiscreteFactor::shared_ptr sum(const Ordering &keys) const override
Create new factor by summing all values with the same separator values.
gtsam
Author(s):
autogenerated on Tue Jan 7 2025 04:02:08