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

#include <DiscreteLookupDAG.h>

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

Public Types

using Base = BayesNet< DiscreteLookupTable >
 
using shared_ptr = std::shared_ptr< This >
 
using This = DiscreteLookupDAG
 
- Public Types inherited from gtsam::BayesNet< DiscreteLookupTable >
typedef std::shared_ptr< DiscreteLookupTablesharedConditional
 A shared pointer to a conditional. More...
 
- Public Types inherited from gtsam::FactorGraph< DiscreteLookupTable >
typedef FastVector< sharedFactor >::const_iterator const_iterator
 
typedef DiscreteLookupTable FactorType
 factor type More...
 
typedef FastVector< sharedFactor >::iterator iterator
 
typedef std::shared_ptr< DiscreteLookupTablesharedFactor
 Shared pointer to a factor. More...
 
typedef sharedFactor value_type
 

Public Member Functions

Testable
bool equals (const This &bn, double tol=1e-9) const
 
Standard Interface
template<typename... Args>
void add (Args &&... args)
 
DiscreteValues argmax (DiscreteValues given=DiscreteValues()) const
 argmax by back-substitution, optionally given certain variables. More...
 
- Public Member Functions inherited from gtsam::BayesNet< DiscreteLookupTable >
void print (const std::string &s="BayesNet", const KeyFormatter &formatter=DefaultKeyFormatter) const override
 
void dot (std::ostream &os, const KeyFormatter &keyFormatter=DefaultKeyFormatter, const DotWriter &writer=DotWriter()) const
 Output to graphviz format, stream version. More...
 
std::string dot (const KeyFormatter &keyFormatter=DefaultKeyFormatter, const DotWriter &writer=DotWriter()) const
 Output to graphviz format string. More...
 
void saveGraph (const std::string &filename, const KeyFormatter &keyFormatter=DefaultKeyFormatter, const DotWriter &writer=DotWriter()) const
 output to file with graphviz format. More...
 
double logProbability (const HybridValues &x) const
 
double evaluate (const HybridValues &c) const
 
- Public Member Functions inherited from gtsam::FactorGraph< DiscreteLookupTable >
 FactorGraph (std::initializer_list< std::shared_ptr< DERIVEDFACTOR >> sharedFactors)
 
virtual ~FactorGraph ()=default
 
void reserve (size_t size)
 
IsDerived< DERIVEDFACTOR > push_back (std::shared_ptr< DERIVEDFACTOR > factor)
 Add a factor directly using a shared_ptr. More...
 
IsDerived< DERIVEDFACTOR > push_back (const DERIVEDFACTOR &factor)
 
IsDerived< DERIVEDFACTOR > emplace_shared (Args &&... args)
 Emplace a shared pointer to factor of given type. More...
 
IsDerived< DERIVEDFACTOR > add (std::shared_ptr< DERIVEDFACTOR > factor)
 add is a synonym for push_back. More...
 
HasDerivedElementType< ITERATOR > push_back (ITERATOR firstFactor, ITERATOR lastFactor)
 
HasDerivedValueType< ITERATOR > push_back (ITERATOR firstFactor, ITERATOR lastFactor)
 Push back many factors with an iterator (factors are copied) More...
 
HasDerivedElementType< CONTAINER > push_back (const CONTAINER &container)
 
HasDerivedValueType< CONTAINER > push_back (const CONTAINER &container)
 Push back non-pointer objects in a container (factors are copied). More...
 
void add (const FACTOR_OR_CONTAINER &factorOrContainer)
 
std::enable_if< std::is_base_of< This, typename CLIQUE::FactorGraphType >::value >::type push_back (const BayesTree< CLIQUE > &bayesTree)
 
FactorIndices add_factors (const CONTAINER &factors, bool useEmptySlots=false)
 
bool equals (const This &fg, double tol=1e-9) const
 Check equality up to tolerance. More...
 
size_t size () const
 
bool empty () const
 
const sharedFactor at (size_t i) const
 
sharedFactorat (size_t i)
 
const sharedFactor operator[] (size_t i) const
 
sharedFactoroperator[] (size_t i)
 
const_iterator begin () const
 
const_iterator end () const
 
sharedFactor front () const
 
sharedFactor back () const
 
double error (const HybridValues &values) const
 
iterator begin ()
 
iterator end ()
 
virtual void resize (size_t size)
 
void remove (size_t i)
 
void replace (size_t index, sharedFactor factor)
 
iterator erase (iterator item)
 
iterator erase (iterator first, iterator last)
 
void dot (std::ostream &os, const KeyFormatter &keyFormatter=DefaultKeyFormatter, const DotWriter &writer=DotWriter()) const
 Output to graphviz format, stream version. More...
 
std::string dot (const KeyFormatter &keyFormatter=DefaultKeyFormatter, const DotWriter &writer=DotWriter()) const
 Output to graphviz format string. More...
 
void saveGraph (const std::string &filename, const KeyFormatter &keyFormatter=DefaultKeyFormatter, const DotWriter &writer=DotWriter()) const
 output to file with graphviz format. More...
 
size_t nrFactors () const
 
KeySet keys () const
 
KeyVector keyVector () const
 
bool exists (size_t idx) const
 

Standard Constructors

 DiscreteLookupDAG ()
 Construct empty DAG. More...
 
static DiscreteLookupDAG FromBayesNet (const DiscreteBayesNet &bayesNet)
 Create from BayesNet with LookupTables. More...
 

Additional Inherited Members

- Protected Member Functions inherited from gtsam::BayesNet< DiscreteLookupTable >
 BayesNet ()
 
 BayesNet (ITERATOR firstConditional, ITERATOR lastConditional)
 
 BayesNet (std::initializer_list< sharedConditional > conditionals)
 
- Protected Member Functions inherited from gtsam::FactorGraph< DiscreteLookupTable >
bool isEqual (const FactorGraph &other) const
 Check exact equality of the factor pointers. Useful for derived ==. More...
 
 FactorGraph ()
 
 FactorGraph (ITERATOR firstFactor, ITERATOR lastFactor)
 
 FactorGraph (const CONTAINER &factors)
 
- Protected Attributes inherited from gtsam::FactorGraph< DiscreteLookupTable >
FastVector< sharedFactorfactors_
 

Detailed Description

A DAG made from lookup tables, as defined above.

Definition at line 77 of file DiscreteLookupDAG.h.

Member Typedef Documentation

◆ Base

Definition at line 79 of file DiscreteLookupDAG.h.

◆ shared_ptr

using gtsam::DiscreteLookupDAG::shared_ptr = std::shared_ptr<This>

Definition at line 81 of file DiscreteLookupDAG.h.

◆ This

Definition at line 80 of file DiscreteLookupDAG.h.

Constructor & Destructor Documentation

◆ DiscreteLookupDAG()

gtsam::DiscreteLookupDAG::DiscreteLookupDAG ( )
inline

Construct empty DAG.

Definition at line 87 of file DiscreteLookupDAG.h.

Member Function Documentation

◆ add()

template<typename... Args>
void gtsam::DiscreteLookupDAG::add ( Args &&...  args)
inline

Add a DiscreteLookupTable

Definition at line 107 of file DiscreteLookupDAG.h.

◆ argmax()

DiscreteValues gtsam::DiscreteLookupDAG::argmax ( DiscreteValues  given = DiscreteValues()) const

argmax by back-substitution, optionally given certain variables.

Assumes the DAG is reverse topologically sorted, i.e. last conditional will be optimized first and that the DAG does not contain any conditionals for the given variables. If the DAG resulted from eliminating a factor graph, this is true for the elimination ordering.

Returns
given assignment extended w. optimal assignment for all variables.

Definition at line 120 of file DiscreteLookupDAG.cpp.

◆ equals()

bool gtsam::DiscreteLookupDAG::equals ( const This bn,
double  tol = 1e-9 
) const

Check equality

◆ FromBayesNet()

DiscreteLookupDAG gtsam::DiscreteLookupDAG::FromBayesNet ( const DiscreteBayesNet bayesNet)
static

Create from BayesNet with LookupTables.

Definition at line 105 of file DiscreteLookupDAG.cpp.


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


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:46:17