STL-based efficient transformation
parent
abe9b281af
commit
b010a240f3
|
@ -45,9 +45,10 @@ DiscreteKeys HybridFactorGraph::discreteKeys() const {
|
|||
/* ************************************************************************* */
|
||||
KeySet HybridFactorGraph::discreteKeySet() const {
|
||||
KeySet keys;
|
||||
for (const DiscreteKey& k : discreteKeys()) {
|
||||
keys.insert(k.first);
|
||||
}
|
||||
DiscreteKeys key_vector = discreteKeys();
|
||||
std::transform(key_vector.begin(), key_vector.end(),
|
||||
std::inserter(keys, keys.begin()),
|
||||
[](const DiscreteKey& k) { return k.first; });
|
||||
return keys;
|
||||
}
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ class HybridFactorGraph : public FactorGraph<Factor> {
|
|||
/// @{
|
||||
|
||||
/// Get all the discrete keys in the factor graph.
|
||||
std::set<DiscreteKey> discreteKeys() const;
|
||||
DiscreteKeys discreteKeys() const;
|
||||
|
||||
/// Get all the discrete keys in the factor graph, as a set.
|
||||
KeySet discreteKeySet() const;
|
||||
|
|
Loading…
Reference in New Issue