diff --git a/gtsam/discrete/DiscreteSearch.h b/gtsam/discrete/DiscreteSearch.h index b610955b2..db3dd5f03 100644 --- a/gtsam/discrete/DiscreteSearch.h +++ b/gtsam/discrete/DiscreteSearch.h @@ -161,4 +161,6 @@ class GTSAM_EXPORT DiscreteSearch { double lowerBound_; ///< Lower bound on the cost-to-go for the entire search. std::vector slots_; ///< The slots to fill in the search. }; + +using DiscreteSearchSolution = DiscreteSearch::Solution; // for wrapping } // namespace gtsam diff --git a/gtsam/discrete/discrete.i b/gtsam/discrete/discrete.i index b84ac69a0..5e4d8d22d 100644 --- a/gtsam/discrete/discrete.i +++ b/gtsam/discrete/discrete.i @@ -464,4 +464,29 @@ class DiscreteJunctionTree { const gtsam::DiscreteCluster& operator[](size_t i) const; }; +#include +class DiscreteSearchSolution { + double error; + gtsam::DiscreteValues assignment; + DiscreteSearchSolution(double error, const gtsam::DiscreteValues& assignment); +}; + +class DiscreteSearch { + static DiscreteSearch FromFactorGraph(const gtsam::DiscreteFactorGraph& factorGraph, + const gtsam::Ordering& ordering, + bool buildJunctionTree = false); + + DiscreteSearch(const gtsam::DiscreteEliminationTree& etree); + DiscreteSearch(const gtsam::DiscreteJunctionTree& junctionTree); + DiscreteSearch(const gtsam::DiscreteBayesNet& bayesNet); + DiscreteSearch(const gtsam::DiscreteBayesTree& bayesTree); + + void print(string name = "DiscreteSearch: ", + const gtsam::KeyFormatter& formatter = gtsam::DefaultKeyFormatter) const; + + double lowerBound() const; + + std::vector run(size_t K = 1) const; +}; + } // namespace gtsam