gtsam 4.1.1
gtsam
gtsam::AlgebraicDecisionTree< L > Class Template Reference

Detailed Description

template<typename L>
class gtsam::AlgebraicDecisionTree< L >

Algebraic Decision Trees fix the range to double Just has some nice constructors and some syntactic sugar TODO: consider eliminating this class altogether?

+ Inheritance diagram for gtsam::AlgebraicDecisionTree< L >:

Public Member Functions

 AlgebraicDecisionTree (const Super &add)
 
 AlgebraicDecisionTree (const L &label, double y1, double y2)
 Create a new leaf function splitting on a variable.
 
 AlgebraicDecisionTree (const typename Super::LabelC &labelC, double y1, double y2)
 Create a new leaf function splitting on a variable.
 
 AlgebraicDecisionTree (const std::vector< typename Super::LabelC > &labelCs, const std::vector< double > &ys)
 Create from keys and vector table.
 
 AlgebraicDecisionTree (const std::vector< typename Super::LabelC > &labelCs, const std::string &table)
 Create from keys and string table.
 
template<typename Iterator >
 AlgebraicDecisionTree (Iterator begin, Iterator end, const L &label)
 Create a new function splitting on a variable.
 
template<typename M >
 AlgebraicDecisionTree (const AlgebraicDecisionTree< M > &other, const std::map< M, L > &map)
 Convert.
 
AlgebraicDecisionTree operator+ (const AlgebraicDecisionTree &g) const
 sum
 
AlgebraicDecisionTree operator* (const AlgebraicDecisionTree &g) const
 product
 
AlgebraicDecisionTree operator/ (const AlgebraicDecisionTree &g) const
 division
 
AlgebraicDecisionTree sum (const L &label, size_t cardinality) const
 sum out variable
 
AlgebraicDecisionTree sum (const typename Super::LabelC &labelC) const
 sum out variable
 
- Public Member Functions inherited from gtsam::DecisionTree< L, double >
 DecisionTree (const double &y)
 Create a constant.
 
 DecisionTree (const L &label, const double &y1, const double &y2)
 Create a new leaf function splitting on a variable.
 
 DecisionTree (const LabelC &label, const double &y1, const double &y2)
 Allow Label+Cardinality for convenience.
 
 DecisionTree (const std::vector< LabelC > &labelCs, const std::vector< double > &ys)
 Create from keys and a corresponding vector of values.
 
 DecisionTree (const std::vector< LabelC > &labelCs, const std::string &table)
 Create from keys and string table.
 
 DecisionTree (Iterator begin, Iterator end, const L &label)
 Create DecisionTree from others.
 
 DecisionTree (const L &label, const DecisionTree &f0, const DecisionTree &f1)
 Create DecisionTree from two others.
 
 DecisionTree (const DecisionTree< M, X > &other, const std::map< M, L > &map, std::function< double(const X &)> op)
 Convert from a different type.
 
 DecisionTree (const NodePtr &root)
 
NodePtr compose (Iterator begin, Iterator end, const L &label) const
 
void print (const std::string &s="DecisionTree") const
 GTSAM-style print.
 
bool equals (const DecisionTree &other, double tol=1e-9) const
 
virtual ~DecisionTree ()
 Make virtual.
 
bool operator== (const DecisionTree &q) const
 equality
 
const double & operator() (const Assignment< L > &x) const
 evaluate
 
DecisionTree apply (const Unary &op) const
 apply Unary operation "op" to f
 
DecisionTree apply (const DecisionTree &g, const Binary &op) const
 apply binary operation "op" to f and g
 
DecisionTree choose (const L &label, size_t index) const
 create a new function where value(label)==index It's like "restrict" in Darwiche09book pg329, 330?
 
DecisionTree combine (const L &label, size_t cardinality, const Binary &op) const
 combine subtrees on key with binary operation "op"
 
DecisionTree combine (const LabelC &labelC, const Binary &op) const
 combine with LabelC for convenience
 
void dot (std::ostream &os, bool showZero=true) const
 output to graphviz format, stream version
 
void dot (const std::string &name, bool showZero=true) const
 output to graphviz format, open a file
 

Public Types

typedef DecisionTree< L, double > Super
 
- Public Types inherited from gtsam::DecisionTree< L, double >
typedef std::function< double(const double &)> Unary
 Handy typedefs for unary and binary function types.
 
typedef std::function< double(const double &, const double &)> Binary
 
typedef std::pair< L, size_t > LabelC
 A label annotated with cardinality.
 
typedef Node::Ptr NodePtr
 ---------------------— Node base class ------------------------— More...
 

Classes

struct  Ring
 The Real ring with addition and multiplication. More...
 

Additional Inherited Members

- Public Attributes inherited from gtsam::DecisionTree< L, double >
NodePtr root_
 
- Protected Member Functions inherited from gtsam::DecisionTree< L, double >
NodePtr create (It begin, It end, ValueIt beginY, ValueIt endY) const
 Internal recursive function to create from keys, cardinalities, and Y values.
 
NodePtr convert (const typename DecisionTree< M, X >::NodePtr &f, const std::map< M, L > &map, std::function< double(const X &)> op)
 Convert to a different type.
 
 DecisionTree ()
 Default constructor.
 

The documentation for this class was generated from the following file: