/** * @file ISAM2.h * @brief Incremental update functionality (ISAM2) for BayesTree, with fluid relinearization. * @author Michael Kaess */ // \callgraph #pragma once #include #include #include #include #include #include #include "Testable.h" #include "FactorGraph.h" #include "NonlinearFactorGraph.h" #include "BayesNet.h" #include "BayesTree.h" namespace gtsam { typedef std::map cachedFactors; template class ISAM2: public BayesTree { protected: // for keeping all original nonlinear data Config config_; NonlinearFactorGraph nonlinearFactors_; // cached intermediate results for restarting computation in the middle cachedFactors cached; public: /** Create an empty Bayes Tree */ ISAM2(); /** Create a Bayes Tree from a Bayes Net */ ISAM2(const NonlinearFactorGraph& fg, const Ordering& ordering, const Config& config); /** Destructor */ virtual ~ISAM2() { } typedef typename BayesTree::sharedClique sharedClique; typedef typename BayesTree::Cliques Cliques; /** * ISAM2. (update_internal provides access to list of orphans for drawing purposes) */ void update_internal(const NonlinearFactorGraph& newFactors, const Config& config, Cliques& orphans); void update(const NonlinearFactorGraph& newFactors, const Config& config); }; // ISAM2 } /// namespace gtsam