switch from DiscreteKeys back to std::set<DiscreteKey>
parent
64743ef685
commit
5e1de8c062
|
@ -25,7 +25,7 @@
|
||||||
namespace gtsam {
|
namespace gtsam {
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
DiscreteKeys HybridFactorGraph::discreteKeys() const {
|
std::set<DiscreteKey> HybridFactorGraph::discreteKeys() const {
|
||||||
std::set<DiscreteKey> keys;
|
std::set<DiscreteKey> keys;
|
||||||
for (auto& factor : factors_) {
|
for (auto& factor : factors_) {
|
||||||
if (auto p = boost::dynamic_pointer_cast<DecisionTreeFactor>(factor)) {
|
if (auto p = boost::dynamic_pointer_cast<DecisionTreeFactor>(factor)) {
|
||||||
|
@ -39,14 +39,14 @@ DiscreteKeys HybridFactorGraph::discreteKeys() const {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return DiscreteKeys(keys.begin(), keys.end());
|
return keys;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
KeySet HybridFactorGraph::discreteKeySet() const {
|
KeySet HybridFactorGraph::discreteKeySet() const {
|
||||||
KeySet keys;
|
KeySet keys;
|
||||||
DiscreteKeys key_vector = discreteKeys();
|
std::set<DiscreteKey> key_set = discreteKeys();
|
||||||
std::transform(key_vector.begin(), key_vector.end(),
|
std::transform(key_set.begin(), key_set.end(),
|
||||||
std::inserter(keys, keys.begin()),
|
std::inserter(keys, keys.begin()),
|
||||||
[](const DiscreteKey& k) { return k.first; });
|
[](const DiscreteKey& k) { return k.first; });
|
||||||
return keys;
|
return keys;
|
||||||
|
|
|
@ -65,7 +65,7 @@ class HybridFactorGraph : public FactorGraph<Factor> {
|
||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
/// Get all the discrete keys in the factor graph.
|
/// Get all the discrete keys in the factor graph.
|
||||||
DiscreteKeys discreteKeys() const;
|
std::set<DiscreteKey> discreteKeys() const;
|
||||||
|
|
||||||
/// Get all the discrete keys in the factor graph, as a set.
|
/// Get all the discrete keys in the factor graph, as a set.
|
||||||
KeySet discreteKeySet() const;
|
KeySet discreteKeySet() const;
|
||||||
|
|
Loading…
Reference in New Issue