/** * @file SymbolicBayesNet.h * @brief Symbolic Chordal Bayes Net, the result of eliminating a factor graph * @author Frank Dellaert */ // \callgraph #pragma once #include #include #include #include "Testable.h" #include "BayesNet.h" #include "SymbolicConditional.h" namespace gtsam { /** * Symbolic Bayes Chain, the (symbolic) result of eliminating a factor graph */ typedef BayesNet SymbolicBayesNet; /** * Construct from a Bayes net of any type */ template SymbolicBayesNet symbolic(const BayesNet& bn) { SymbolicBayesNet result; typename BayesNet::const_iterator it = bn.begin(); for (; it != bn.end(); it++) { boost::shared_ptr conditional = *it; std::string key = conditional->key(); std::list parents = conditional->parents(); SymbolicConditional::shared_ptr c(new SymbolicConditional(key, parents)); result.push_back(c); } return result; } } /// namespace gtsam