Export
parent
16131fe8c9
commit
41fdeb6c04
|
@ -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.
|
||||||
*
|
*
|
||||||
|
|
|
@ -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.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue