Public Types | List of all members
gtsam::DecisionTreeFactor Class Reference

#include <DecisionTreeFactor.h>

Inheritance diagram for gtsam::DecisionTreeFactor:
Inheritance graph
[legend]

Public Types

typedef DiscreteFactor Base
 Typedef to base class. More...
 
typedef boost::shared_ptr< DecisionTreeFactorshared_ptr
 
typedef DecisionTreeFactor This
 
- Public Types inherited from gtsam::DiscreteFactor
typedef Factor Base
 Our base class. More...
 
typedef boost::shared_ptr< DiscreteFactorshared_ptr
 shared_ptr to this class More...
 
typedef boost::shared_ptr< ValuessharedValues
 
typedef DiscreteFactor This
 This class. More...
 
typedef Assignment< KeyValues
 
- Public Types inherited from gtsam::Factor
typedef KeyVector::const_iterator const_iterator
 Const iterator over keys. More...
 
typedef KeyVector::iterator iterator
 Iterator over keys. More...
 
- Public Types inherited from gtsam::Potentials
typedef AlgebraicDecisionTree< KeyADT
 
- Public Types inherited from gtsam::AlgebraicDecisionTree< Key >
typedef DecisionTree< Key, double > Super
 
- Public Types inherited from gtsam::DecisionTree< Key, double >
typedef boost::function< double(const double &, const double &)> Binary
 
typedef std::pair< Key, size_tLabelC
 
typedef Node::Ptr NodePtr
 
typedef boost::function< double(const double &)> Unary
 

Public Member Functions

Standard Constructors
 DecisionTreeFactor ()
 
 DecisionTreeFactor (const DiscreteKeys &keys, const ADT &potentials)
 
template<class SOURCE >
 DecisionTreeFactor (const DiscreteKeys &keys, SOURCE table)
 
 DecisionTreeFactor (const DiscreteConditional &c)
 
Testable
bool equals (const DiscreteFactor &other, double tol=1e-9) const override
 equality More...
 
void print (const std::string &s="DecisionTreeFactor:\n", const KeyFormatter &formatter=DefaultKeyFormatter) const override
 print More...
 
Standard Interface
double operator() (const Values &values) const override
 Value is just look up in AlgebraicDecisonTree. More...
 
DecisionTreeFactor operator* (const DecisionTreeFactor &f) const override
 multiply two factors More...
 
DecisionTreeFactor operator/ (const DecisionTreeFactor &f) const
 divide by factor f (safely) More...
 
DecisionTreeFactor toDecisionTreeFactor () const override
 Convert into a decisiontree. More...
 
shared_ptr sum (size_t nrFrontals) const
 Create new factor by summing all values with the same separator values. More...
 
shared_ptr sum (const Ordering &keys) const
 Create new factor by summing all values with the same separator values. More...
 
shared_ptr max (size_t nrFrontals) const
 Create new factor by maximizing over all values with the same separator values. More...
 
Advanced Interface
DecisionTreeFactor apply (const DecisionTreeFactor &f, ADT::Binary op) const
 
shared_ptr combine (size_t nrFrontals, ADT::Binary op) const
 
shared_ptr combine (const Ordering &keys, ADT::Binary op) const
 
- Public Member Functions inherited from gtsam::DiscreteFactor
 DiscreteFactor ()
 
template<typename CONTAINER >
 DiscreteFactor (const CONTAINER &keys)
 
virtual ~DiscreteFactor ()
 Virtual destructor. More...
 
void print (const std::string &s="DiscreteFactor\n", const KeyFormatter &formatter=DefaultKeyFormatter) const override
 print More...
 
virtual bool empty () const
 
- Public Member Functions inherited from gtsam::Factor
virtual ~Factor ()=default
 Default destructor. More...
 
KeyVectorkeys ()
 
iterator begin ()
 
iterator end ()
 
virtual void printKeys (const std::string &s="Factor", const KeyFormatter &formatter=DefaultKeyFormatter) const
 print only keys More...
 
Key front () const
 First key. More...
 
Key back () const
 Last key. More...
 
const_iterator find (Key key) const
 find More...
 
const KeyVectorkeys () const
 Access the factor's involved variable keys. More...
 
const_iterator begin () const
 
const_iterator end () const
 
size_t size () const
 
- Public Member Functions inherited from gtsam::Potentials
size_t cardinality (Key j) const
 
GTSAM_EXPORT bool equals (const Potentials &other, double tol=1e-9) const
 
GTSAM_EXPORT Potentials ()
 
GTSAM_EXPORT Potentials (const DiscreteKeys &keys, const ADT &decisionTree)
 
template<class SOURCE >
 Potentials (const DiscreteKeys &keys, SOURCE table)
 
GTSAM_EXPORT void print (const std::string &s="Potentials: ", const KeyFormatter &formatter=DefaultKeyFormatter) const
 
- Public Member Functions inherited from gtsam::AlgebraicDecisionTree< Key >
 AlgebraicDecisionTree ()
 
 AlgebraicDecisionTree (const Super &add)
 
 AlgebraicDecisionTree (const Key &label, double y1, double y2)
 
 AlgebraicDecisionTree (const typename Super::LabelC &labelC, double y1, double y2)
 
 AlgebraicDecisionTree (const std::vector< typename Super::LabelC > &labelCs, const std::vector< double > &ys)
 
 AlgebraicDecisionTree (const std::vector< typename Super::LabelC > &labelCs, const std::string &table)
 
 AlgebraicDecisionTree (Iterator begin, Iterator end, const Key &label)
 
 AlgebraicDecisionTree (const AlgebraicDecisionTree< M > &other, const std::map< M, Key > &map)
 
AlgebraicDecisionTree operator* (const AlgebraicDecisionTree &g) const
 
AlgebraicDecisionTree operator+ (const AlgebraicDecisionTree &g) const
 
AlgebraicDecisionTree operator/ (const AlgebraicDecisionTree &g) const
 
AlgebraicDecisionTree sum (const Key &label, size_t cardinality) const
 
AlgebraicDecisionTree sum (const typename Super::LabelC &labelC) const
 
- Public Member Functions inherited from gtsam::DecisionTree< Key, double >
 DecisionTree (const double &y)
 
 DecisionTree (const Key &label, const double &y1, const double &y2)
 
 DecisionTree (const LabelC &label, const double &y1, const double &y2)
 
 DecisionTree (const std::vector< LabelC > &labelCs, const std::vector< double > &ys)
 
 DecisionTree (const std::vector< LabelC > &labelCs, const std::string &table)
 
 DecisionTree (Iterator begin, Iterator end, const Key &label)
 
 DecisionTree (const Key &label, const DecisionTree &f0, const DecisionTree &f1)
 
 DecisionTree (const DecisionTree< M, X > &other, const std::map< M, Key > &map, boost::function< double(const X &)> op)
 
 DecisionTree (const NodePtr &root)
 
NodePtr compose (Iterator begin, Iterator end, const Key &label) const
 
void print (const std::string &s="DecisionTree") const
 
bool equals (const DecisionTree &other, double tol=1e-9) const
 
virtual ~DecisionTree ()
 
bool operator== (const DecisionTree &q) const
 
const double & operator() (const Assignment< Key > &x) const
 
DecisionTree apply (const Unary &op) const
 
DecisionTree apply (const DecisionTree &g, const Binary &op) const
 
DecisionTree choose (const Key &label, size_t index) const
 
DecisionTree combine (const Key &label, size_t cardinality, const Binary &op) const
 
DecisionTree combine (const LabelC &labelC, const Binary &op) const
 
void dot (std::ostream &os, bool showZero=true) const
 
void dot (const std::string &name, bool showZero=true) const
 

Additional Inherited Members

- Public Attributes inherited from gtsam::DecisionTree< Key, double >
NodePtr root_
 
- Protected Member Functions inherited from gtsam::Factor
 Factor ()
 
template<typename CONTAINER >
 Factor (const CONTAINER &keys)
 
template<typename ITERATOR >
 Factor (ITERATOR first, ITERATOR last)
 
bool equals (const This &other, double tol=1e-9) const
 check equality More...
 
- Protected Member Functions inherited from gtsam::Potentials
 Potentials (const ADT &potentials)
 
- Protected Member Functions inherited from gtsam::DecisionTree< Key, double >
NodePtr convert (const typename DecisionTree< M, X >::NodePtr &f, const std::map< M, Key > &map, boost::function< double(const X &)> op)
 
NodePtr create (It begin, It end, ValueIt beginY, ValueIt endY) const
 
 DecisionTree ()
 
- Static Protected Member Functions inherited from gtsam::Factor
template<typename CONTAINER >
static Factor FromKeys (const CONTAINER &keys)
 
template<typename ITERATOR >
static Factor FromIterators (ITERATOR first, ITERATOR last)
 
- Static Protected Member Functions inherited from gtsam::Potentials
static GTSAM_EXPORT double safe_div (const double &a, const double &b)
 
- Protected Attributes inherited from gtsam::Factor
KeyVector keys_
 The keys involved in this factor. More...
 
- Protected Attributes inherited from gtsam::Potentials
std::map< Key, size_tcardinalities_
 Cardinality for each key, used in combine. More...
 

Detailed Description

A discrete probabilistic factor

Definition at line 38 of file DecisionTreeFactor.h.

Member Typedef Documentation

Typedef to base class.

Definition at line 44 of file DecisionTreeFactor.h.

Definition at line 45 of file DecisionTreeFactor.h.

Definition at line 43 of file DecisionTreeFactor.h.

Constructor & Destructor Documentation

gtsam::DecisionTreeFactor::DecisionTreeFactor ( )

Default constructor for I/O

Definition at line 31 of file DecisionTreeFactor.cpp.

gtsam::DecisionTreeFactor::DecisionTreeFactor ( const DiscreteKeys keys,
const ADT potentials 
)

Constructor from Indices, Ordering, and AlgebraicDecisionDiagram

Definition at line 35 of file DecisionTreeFactor.cpp.

template<class SOURCE >
gtsam::DecisionTreeFactor::DecisionTreeFactor ( const DiscreteKeys keys,
SOURCE  table 
)
inline

Constructor from Indices and (string or doubles)

Definition at line 60 of file DecisionTreeFactor.h.

gtsam::DecisionTreeFactor::DecisionTreeFactor ( const DiscreteConditional c)

Construct from a DiscreteConditional type

Definition at line 41 of file DecisionTreeFactor.cpp.

Member Function Documentation

DecisionTreeFactor gtsam::DecisionTreeFactor::apply ( const DecisionTreeFactor f,
ADT::Binary  op 
) const

Apply binary operator (*this) "op" f

Parameters
fthe second argument for op
opa binary operator that operates on AlgebraicDecisionDiagram potentials

Definition at line 64 of file DecisionTreeFactor.cpp.

DecisionTreeFactor::shared_ptr gtsam::DecisionTreeFactor::combine ( size_t  nrFrontals,
ADT::Binary  op 
) const

Combine frontal variables using binary operator "op"

Parameters
nrFrontalsnr. of frontal to combine variables in this factor
opa binary operator that operates on AlgebraicDecisionDiagram potentials
Returns
shared pointer to newly created DecisionTreeFactor

Definition at line 81 of file DecisionTreeFactor.cpp.

DecisionTreeFactor::shared_ptr gtsam::DecisionTreeFactor::combine ( const Ordering keys,
ADT::Binary  op 
) const

Combine frontal variables in an Ordering using binary operator "op"

Parameters
nrFrontalsnr. of frontal to combine variables in this factor
opa binary operator that operates on AlgebraicDecisionDiagram potentials
Returns
shared pointer to newly created DecisionTreeFactor

Definition at line 108 of file DecisionTreeFactor.cpp.

bool gtsam::DecisionTreeFactor::equals ( const DiscreteFactor other,
double  tol = 1e-9 
) const
overridevirtual

equality

Implements gtsam::DiscreteFactor.

Reimplemented in gtsam::DiscreteConditional.

Definition at line 46 of file DecisionTreeFactor.cpp.

shared_ptr gtsam::DecisionTreeFactor::max ( size_t  nrFrontals) const
inline

Create new factor by maximizing over all values with the same separator values.

Definition at line 113 of file DecisionTreeFactor.h.

double gtsam::DecisionTreeFactor::operator() ( const Values values) const
inlineoverridevirtual

Value is just look up in AlgebraicDecisonTree.

Implements gtsam::DiscreteFactor.

Reimplemented in gtsam::DiscreteConditional.

Definition at line 83 of file DecisionTreeFactor.h.

DecisionTreeFactor gtsam::DecisionTreeFactor::operator* ( const DecisionTreeFactor f) const
inlineoverridevirtual

multiply two factors

Implements gtsam::DiscreteFactor.

Definition at line 88 of file DecisionTreeFactor.h.

DecisionTreeFactor gtsam::DecisionTreeFactor::operator/ ( const DecisionTreeFactor f) const
inline

divide by factor f (safely)

Definition at line 93 of file DecisionTreeFactor.h.

void gtsam::DecisionTreeFactor::print ( const std::string &  s = "DecisionTreeFactor:\n",
const KeyFormatter formatter = DefaultKeyFormatter 
) const
overridevirtual

print

Reimplemented from gtsam::Factor.

Reimplemented in gtsam::DiscreteConditional.

Definition at line 57 of file DecisionTreeFactor.cpp.

shared_ptr gtsam::DecisionTreeFactor::sum ( size_t  nrFrontals) const
inline

Create new factor by summing all values with the same separator values.

Definition at line 103 of file DecisionTreeFactor.h.

shared_ptr gtsam::DecisionTreeFactor::sum ( const Ordering keys) const
inline

Create new factor by summing all values with the same separator values.

Definition at line 108 of file DecisionTreeFactor.h.

DecisionTreeFactor gtsam::DecisionTreeFactor::toDecisionTreeFactor ( ) const
inlineoverridevirtual

Convert into a decisiontree.

Implements gtsam::DiscreteFactor.

Definition at line 98 of file DecisionTreeFactor.h.


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


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