/* * SymbolicFactorGraph.h * * Created on: Oct 29, 2009 * Author: Frank Dellaert */ #ifndef SYMBOLICFACTORGRAPH_H_ #define SYMBOLICFACTORGRAPH_H_ #include #include #include "FactorGraph.h" #include "SymbolicFactor.h" namespace gtsam { class SymbolicBayesNet; class SymbolicConditional; /** Symbolic Factor Graph */ class SymbolicFactorGraph: public FactorGraph { public: /** * Construct empty factor graph */ SymbolicFactorGraph() { } /** * Construct from a factor graph of any type */ template SymbolicFactorGraph(const FactorGraph& fg) { for (size_t i = 0; i < fg.size(); i++) { boost::shared_ptr f = fg[i]; std::list keys = f->keys(); SymbolicFactor::shared_ptr factor(new SymbolicFactor(keys)); push_back(factor); } } /** * Eliminate a single node yielding a conditional Gaussian * Eliminates the factors from the factor graph through findAndRemoveFactors * and adds a new factor on the separator to the factor graph */ inline boost::shared_ptr eliminateOne(const std::string& key){ return _eliminateOne(*this, key); } /** * eliminate factor graph in place(!) in the given order, yielding * a chordal Bayes net */ boost::shared_ptr eliminate(const Ordering& ordering); }; } #endif /* SYMBOLICFACTORGRAPH_H_ */