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

#include <DecisionTree-inl.h>

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

Public Member Functions

NodePtr apply (const Unary &op) const override
 
NodePtr apply (const UnaryAssignment &op, const Assignment< L > &assignment) const override
 Apply unary operator with assignment. More...
 
NodePtr apply_f_op_g (const Node &g, const Binary &op) const override
 
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
 
NodePtr choose (const L &label, size_t index) const override
 
const Yconstant () const
 Return the constant. More...
 
void dot (std::ostream &os, const LabelFormatter &labelFormatter, const ValueFormatter &valueFormatter, bool showZero) const override
 
bool equals (const Node &q, const CompareFunc &compare) const override
 equality up to tolerance More...
 
bool isLeaf () const override
 
 Leaf ()
 Default constructor for serialization. More...
 
 Leaf (const Y &constant)
 Constructor from constant. More...
 
const Yoperator() (const Assignment< L > &x) const override
 
void print (const std::string &s, const LabelFormatter &labelFormatter, const ValueFormatter &valueFormatter) const override
 print More...
 
bool sameLeaf (const Leaf &q) const override
 Leaf-Leaf equality. More...
 
bool sameLeaf (const Node &q) const override
 polymorphic equality: is q a leaf and is it the same as this leaf? More...
 
- Public Member Functions inherited from gtsam::DecisionTree< L, Y >::Node
const void * id () const
 
 Node ()
 
virtual ~Node ()
 

Public Attributes

Y constant_
 

Private Types

using Base = DecisionTree< L, Y >::Node
 

Additional Inherited Members

- Public Types inherited from gtsam::DecisionTree< L, Y >::Node
using Ptr = std::shared_ptr< Node >
 

Detailed Description

template<typename L, typename Y>
template<typename L, typename Y>
struct gtsam::DecisionTree< L, Y >::Leaf< L, Y >

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

Member Typedef Documentation

◆ Base

template<typename L , typename Y >
template<typename L , typename Y >
using gtsam::DecisionTree< L, Y >::Leaf< L, Y >::Base = DecisionTree<L, Y>::Node
private

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

Constructor & Destructor Documentation

◆ Leaf() [1/2]

template<typename L , typename Y >
template<typename L , typename Y >
gtsam::DecisionTree< L, Y >::Leaf< L, Y >::Leaf ( )
inline

Default constructor for serialization.

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

◆ Leaf() [2/2]

template<typename L , typename Y >
template<typename L , typename Y >
gtsam::DecisionTree< L, Y >::Leaf< L, Y >::Leaf ( const Y constant)
inline

Constructor from constant.

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

Member Function Documentation

◆ apply() [1/2]

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

apply unary operator

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

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

◆ apply() [2/2]

template<typename L , typename Y >
template<typename L , typename Y >
NodePtr gtsam::DecisionTree< L, Y >::Leaf< L, Y >::apply ( const UnaryAssignment op,
const Assignment< L > &  assignment 
) const
inlineoverridevirtual

Apply unary operator with assignment.

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

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

◆ apply_f_op_g()

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

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

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

◆ apply_g_op_fC()

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

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

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

◆ apply_g_op_fL()

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

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

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

◆ choose()

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

choose a branch, create new memory !

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

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

◆ constant()

template<typename L , typename Y >
template<typename L , typename Y >
const Y& gtsam::DecisionTree< L, Y >::Leaf< L, Y >::constant ( ) const
inline

Return the constant.

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

◆ dot()

template<typename L , typename Y >
template<typename L , typename Y >
void gtsam::DecisionTree< L, Y >::Leaf< L, Y >::dot ( std::ostream &  os,
const LabelFormatter labelFormatter,
const ValueFormatter valueFormatter,
bool  showZero 
) const
inlineoverridevirtual

Write graphviz format to stream os.

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

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

◆ equals()

template<typename L , typename Y >
template<typename L , typename Y >
bool gtsam::DecisionTree< L, Y >::Leaf< L, Y >::equals ( const Node q,
const CompareFunc compare 
) const
inlineoverridevirtual

equality up to tolerance

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

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

◆ isLeaf()

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

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

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

◆ operator()()

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

evaluate

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

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

◆ print()

template<typename L , typename Y >
template<typename L , typename Y >
void gtsam::DecisionTree< L, Y >::Leaf< L, Y >::print ( const std::string &  s,
const LabelFormatter labelFormatter,
const ValueFormatter valueFormatter 
) const
inlineoverridevirtual

print

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

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

◆ sameLeaf() [1/2]

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

Leaf-Leaf equality.

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

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

◆ sameLeaf() [2/2]

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

polymorphic equality: is q a leaf and is it the same as this leaf?

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

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

Member Data Documentation

◆ constant_

template<typename L , typename Y >
template<typename L , typename Y >
Y gtsam::DecisionTree< L, Y >::Leaf< L, Y >::constant_

constant stored in this leaf

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


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


gtsam
Author(s):
autogenerated on Fri Nov 1 2024 03:51:15