#include <DiscreteLookupDAG.h>
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< DiscreteLookupTable > | sharedConditional |
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< DiscreteLookupTable > | sharedFactor |
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... | |
std::enable_if< std::is_base_of< FactorType, DERIVEDFACTOR >::value, This >::type & | operator+= (std::shared_ptr< DERIVEDFACTOR > factor) |
Append factor to factor graph. More... | |
std::enable_if< std::is_base_of< FactorType, DERIVEDFACTOR >::value, This >::type & | operator, (std::shared_ptr< DERIVEDFACTOR > factor) |
Overload comma operator to allow for append chaining. 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) |
This & | operator+= (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 |
sharedFactor & | at (size_t i) |
std::shared_ptr< F > | at (size_t i) |
const std::shared_ptr< F > | at (size_t i) const |
Const version of templated at method. More... | |
const sharedFactor | operator[] (size_t i) const |
sharedFactor & | operator[] (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< sharedFactor > | factors_ |
A DAG made from lookup tables, as defined above.
Definition at line 77 of file DiscreteLookupDAG.h.
Definition at line 79 of file DiscreteLookupDAG.h.
using gtsam::DiscreteLookupDAG::shared_ptr = std::shared_ptr<This> |
Definition at line 81 of file DiscreteLookupDAG.h.
Definition at line 80 of file DiscreteLookupDAG.h.
|
inline |
Construct empty DAG.
Definition at line 87 of file DiscreteLookupDAG.h.
|
inline |
Add a DiscreteLookupTable
Definition at line 107 of file DiscreteLookupDAG.h.
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.
Definition at line 121 of file DiscreteLookupDAG.cpp.
|
static |
Create from BayesNet with LookupTables.
Definition at line 106 of file DiscreteLookupDAG.cpp.