STL-based efficient transformation
parent
abe9b281af
commit
b010a240f3
|
@ -45,9 +45,10 @@ DiscreteKeys HybridFactorGraph::discreteKeys() const {
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
KeySet HybridFactorGraph::discreteKeySet() const {
|
KeySet HybridFactorGraph::discreteKeySet() const {
|
||||||
KeySet keys;
|
KeySet keys;
|
||||||
for (const DiscreteKey& k : discreteKeys()) {
|
DiscreteKeys key_vector = discreteKeys();
|
||||||
keys.insert(k.first);
|
std::transform(key_vector.begin(), key_vector.end(),
|
||||||
}
|
std::inserter(keys, keys.begin()),
|
||||||
|
[](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.
|
||||||
std::set<DiscreteKey> discreteKeys() const;
|
DiscreteKeys 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