Public Member Functions | Static Public Member Functions | Private Types | Private Attributes | List of all members
gtsam::DecisionTree< L, Y >::Choice< L, Y > Class Template Reference

#include <DecisionTree-inl.h>

Inheritance diagram for gtsam::DecisionTree< L, Y >::Choice< L, Y >:
Inheritance graph
[legend]

Public Member Functions

NodePtr apply (const Unary &op) const override
 
NodePtr apply_f_op_g (const Node &g, const Binary &op) const override
 
template<typename OP >
NodePtr apply_fC_op_gL (const Leaf &gL, OP op) const
 
NodePtr apply_g_op_fC (const Choice &fC, const Binary &op) const override
 
NodePtr apply_g_op_fL (const Leaf &fL, const Binary &op) const override
 
const std::vector< NodePtr > & branches () const
 
 Choice (const L &label, size_t count)
 
 Choice (const Choice &f, const Choice &g, const Binary &op)
 
 Choice (const L &label, const Choice &f, const Unary &op)
 
NodePtr choose (const L &label, size_t index) const override
 
void dot (std::ostream &os, bool showZero) const override
 
bool equals (const Node &q, double tol) const override
 
bool isLeaf () const override
 
const Llabel () const
 
size_t nrChoices () const
 
const Yoperator() (const Assignment< L > &x) const override
 
void print (const std::string &s) const override
 
void push_back (const NodePtr &node)
 
bool sameLeaf (const Leaf &q) const override
 Choice-Leaf equality: always false. More...
 
bool sameLeaf (const Node &q) const override
 polymorphic equality: if q is a leaf, could be... More...
 
 ~Choice () override
 
- Public Member Functions inherited from gtsam::DecisionTree< L, Y >::Node
const void * id () const
 
 Node ()
 
virtual ~Node ()
 

Static Public Member Functions

static NodePtr Unique (const ChoicePtr &f)
 

Private Types

typedef boost::shared_ptr< const ChoiceChoicePtr
 

Private Attributes

size_t allSame_
 
std::vector< NodePtrbranches_
 
L label_
 

Additional Inherited Members

- Public Types inherited from gtsam::DecisionTree< L, Y >::Node
typedef boost::shared_ptr< const NodePtr
 

Detailed Description

template<typename L, typename Y>
template<typename L, typename Y>
class gtsam::DecisionTree< L, Y >::Choice< L, Y >

Definition at line 142 of file DecisionTree-inl.h.

Member Typedef Documentation

template<typename L, typename Y>
template<typename L , typename Y >
typedef boost::shared_ptr<const Choice> gtsam::DecisionTree< L, Y >::Choice< L, Y >::ChoicePtr
private

Definition at line 154 of file DecisionTree-inl.h.

Constructor & Destructor Documentation

template<typename L, typename Y>
template<typename L , typename Y >
gtsam::DecisionTree< L, Y >::Choice< L, Y >::~Choice ( )
inlineoverride

Definition at line 158 of file DecisionTree-inl.h.

template<typename L, typename Y>
template<typename L , typename Y >
gtsam::DecisionTree< L, Y >::Choice< L, Y >::Choice ( const L label,
size_t  count 
)
inline

Constructor, given choice label and mandatory expected branch count

Definition at line 181 of file DecisionTree-inl.h.

template<typename L, typename Y>
template<typename L , typename Y >
gtsam::DecisionTree< L, Y >::Choice< L, Y >::Choice ( const Choice< L, Y > &  f,
const Choice< L, Y > &  g,
const Binary op 
)
inline

Construct from applying binary op to two Choice nodes

Definition at line 189 of file DecisionTree-inl.h.

template<typename L, typename Y>
template<typename L , typename Y >
gtsam::DecisionTree< L, Y >::Choice< L, Y >::Choice ( const L label,
const Choice< L, Y > &  f,
const Unary op 
)
inline

Construct from applying unary op to a Choice node

Definition at line 308 of file DecisionTree-inl.h.

Member Function Documentation

template<typename L, typename Y>
template<typename L , typename Y >
NodePtr gtsam::DecisionTree< L, Y >::Choice< L, Y >::apply ( const Unary op) const
inlineoverridevirtual

apply unary operator

Implements gtsam::DecisionTree< L, Y >::Node.

Definition at line 317 of file DecisionTree-inl.h.

template<typename L, typename Y>
template<typename L , typename Y >
NodePtr gtsam::DecisionTree< L, Y >::Choice< L, Y >::apply_f_op_g ( const Node g,
const Binary op 
) const
inlineoverridevirtual

Implements gtsam::DecisionTree< L, Y >::Node.

Definition at line 327 of file DecisionTree-inl.h.

template<typename L, typename Y>
template<typename L , typename Y >
template<typename OP >
NodePtr gtsam::DecisionTree< L, Y >::Choice< L, Y >::apply_fC_op_gL ( const Leaf gL,
OP  op 
) const
inline

Definition at line 347 of file DecisionTree-inl.h.

template<typename L, typename Y>
template<typename L , typename Y >
NodePtr gtsam::DecisionTree< L, Y >::Choice< L, Y >::apply_g_op_fC ( const Choice< L, Y > &  fC,
const Binary op 
) const
inlineoverridevirtual

Implements gtsam::DecisionTree< L, Y >::Node.

Definition at line 340 of file DecisionTree-inl.h.

template<typename L, typename Y>
template<typename L , typename Y >
NodePtr gtsam::DecisionTree< L, Y >::Choice< L, Y >::apply_g_op_fL ( const Leaf fL,
const Binary op 
) const
inlineoverridevirtual

Implements gtsam::DecisionTree< L, Y >::Node.

Definition at line 332 of file DecisionTree-inl.h.

template<typename L, typename Y>
template<typename L , typename Y >
const std::vector<NodePtr>& gtsam::DecisionTree< L, Y >::Choice< L, Y >::branches ( ) const
inline

Definition at line 225 of file DecisionTree-inl.h.

template<typename L, typename Y>
template<typename L , typename Y >
NodePtr gtsam::DecisionTree< L, Y >::Choice< L, Y >::choose ( const L label,
size_t  index 
) const
inlineoverridevirtual

choose a branch, recursively

Implements gtsam::DecisionTree< L, Y >::Node.

Definition at line 355 of file DecisionTree-inl.h.

template<typename L, typename Y>
template<typename L , typename Y >
void gtsam::DecisionTree< L, Y >::Choice< L, Y >::dot ( std::ostream &  os,
bool  showZero 
) const
inlineoverridevirtual

output to graphviz (as a a graph)

Implements gtsam::DecisionTree< L, Y >::Node.

Definition at line 248 of file DecisionTree-inl.h.

template<typename L, typename Y>
template<typename L , typename Y >
bool gtsam::DecisionTree< L, Y >::Choice< L, Y >::equals ( const Node q,
double  tol 
) const
inlineoverridevirtual

equality up to tolerance

Implements gtsam::DecisionTree< L, Y >::Node.

Definition at line 279 of file DecisionTree-inl.h.

template<typename L, typename Y>
template<typename L , typename Y >
bool gtsam::DecisionTree< L, Y >::Choice< L, Y >::isLeaf ( ) const
inlineoverridevirtual

Implements gtsam::DecisionTree< L, Y >::Node.

Definition at line 178 of file DecisionTree-inl.h.

template<typename L, typename Y>
template<typename L , typename Y >
const L& gtsam::DecisionTree< L, Y >::Choice< L, Y >::label ( ) const
inline

Definition at line 217 of file DecisionTree-inl.h.

template<typename L, typename Y>
template<typename L , typename Y >
size_t gtsam::DecisionTree< L, Y >::Choice< L, Y >::nrChoices ( ) const
inline

Definition at line 221 of file DecisionTree-inl.h.

template<typename L, typename Y>
template<typename L , typename Y >
const Y& gtsam::DecisionTree< L, Y >::Choice< L, Y >::operator() ( const Assignment< L > &  x) const
inlineoverridevirtual

evaluate

Implements gtsam::DecisionTree< L, Y >::Node.

Definition at line 291 of file DecisionTree-inl.h.

template<typename L, typename Y>
template<typename L , typename Y >
void gtsam::DecisionTree< L, Y >::Choice< L, Y >::print ( const std::string &  s) const
inlineoverridevirtual

print (as a tree)

Implements gtsam::DecisionTree< L, Y >::Node.

Definition at line 239 of file DecisionTree-inl.h.

template<typename L, typename Y>
template<typename L , typename Y >
void gtsam::DecisionTree< L, Y >::Choice< L, Y >::push_back ( const NodePtr node)
inline

add a branch: TODO merge into constructor

Definition at line 230 of file DecisionTree-inl.h.

template<typename L, typename Y>
template<typename L , typename Y >
bool gtsam::DecisionTree< L, Y >::Choice< L, Y >::sameLeaf ( const Leaf q) const
inlineoverridevirtual

Choice-Leaf equality: always false.

Implements gtsam::DecisionTree< L, Y >::Node.

Definition at line 269 of file DecisionTree-inl.h.

template<typename L, typename Y>
template<typename L , typename Y >
bool gtsam::DecisionTree< L, Y >::Choice< L, Y >::sameLeaf ( const Node q) const
inlineoverridevirtual

polymorphic equality: if q is a leaf, could be...

Implements gtsam::DecisionTree< L, Y >::Node.

Definition at line 274 of file DecisionTree-inl.h.

template<typename L, typename Y>
template<typename L , typename Y >
static NodePtr gtsam::DecisionTree< L, Y >::Choice< L, Y >::Unique ( const ChoicePtr f)
inlinestatic

If all branches of a choice node f are the same, just return a branch

Definition at line 165 of file DecisionTree-inl.h.

Member Data Documentation

template<typename L, typename Y>
template<typename L , typename Y >
size_t gtsam::DecisionTree< L, Y >::Choice< L, Y >::allSame_
private

incremental allSame

Definition at line 152 of file DecisionTree-inl.h.

template<typename L, typename Y>
template<typename L , typename Y >
std::vector<NodePtr> gtsam::DecisionTree< L, Y >::Choice< L, Y >::branches_
private

The children of this Choice node.

Definition at line 148 of file DecisionTree-inl.h.

template<typename L, typename Y>
template<typename L , typename Y >
L gtsam::DecisionTree< L, Y >::Choice< L, Y >::label_
private

the label of the variable on which we split

Definition at line 145 of file DecisionTree-inl.h.


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


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:58:07