release/4.3a0
Frank Dellaert 2025-01-27 14:51:16 -05:00
parent 16131fe8c9
commit 41fdeb6c04
2 changed files with 17 additions and 15 deletions

View File

@ -20,6 +20,8 @@
namespace gtsam { namespace gtsam {
using Solution = DiscreteSearch::Solution;
/** /**
* @brief Represents a node in the search tree for discrete search algorithms. * @brief Represents a node in the search tree for discrete search algorithms.
* *

View File

@ -23,25 +23,25 @@
namespace gtsam { namespace gtsam {
/**
* @brief A solution to a discrete search problem.
*/
struct Solution {
double error;
DiscreteValues assignment;
Solution(double err, const DiscreteValues& assign)
: error(err), assignment(assign) {}
friend std::ostream& operator<<(std::ostream& os, const Solution& sn) {
os << "[ error=" << sn.error << " assignment={" << sn.assignment << "}]";
return os;
}
};
/** /**
* DiscreteSearch: Search for the K best solutions. * DiscreteSearch: Search for the K best solutions.
*/ */
class DiscreteSearch { class GTSAM_EXPORT DiscreteSearch {
public: public:
/**
* @brief A solution to a discrete search problem.
*/
struct Solution {
double error;
DiscreteValues assignment;
Solution(double err, const DiscreteValues& assign)
: error(err), assignment(assign) {}
friend std::ostream& operator<<(std::ostream& os, const Solution& sn) {
os << "[ error=" << sn.error << " assignment={" << sn.assignment << "}]";
return os;
}
};
/** /**
* Construct from a DiscreteBayesNet and K. * Construct from a DiscreteBayesNet and K.
*/ */