diff --git a/gtsam/hybrid/HybridFactorGraph.h b/gtsam/hybrid/HybridFactorGraph.h index ea071a020..05a17b000 100644 --- a/gtsam/hybrid/HybridFactorGraph.h +++ b/gtsam/hybrid/HybridFactorGraph.h @@ -137,7 +137,7 @@ class HybridFactorGraph : public FactorGraph { } /// Get all the discrete keys in the factor graph. - const KeySet allDiscreteKeys() const { + const KeySet discreteKeys() const { KeySet discrete_keys; for (auto& factor : factors_) { for (const DiscreteKey& k : factor->discreteKeys()) { @@ -148,7 +148,7 @@ class HybridFactorGraph : public FactorGraph { } /// Get all the continuous keys in the factor graph. - const KeySet allContinuousKeys() const { + const KeySet continuousKeys() const { KeySet keys; for (auto& factor : factors_) { for (const Key& key : factor->continuousKeys()) { diff --git a/gtsam/hybrid/HybridGaussianFactorGraph.cpp b/gtsam/hybrid/HybridGaussianFactorGraph.cpp index c08e774f2..ddb776ff4 100644 --- a/gtsam/hybrid/HybridGaussianFactorGraph.cpp +++ b/gtsam/hybrid/HybridGaussianFactorGraph.cpp @@ -406,7 +406,7 @@ void HybridGaussianFactorGraph::add(DecisionTreeFactor::shared_ptr factor) { /* ************************************************************************ */ const Ordering HybridGaussianFactorGraph::getHybridOrdering() const { - KeySet discrete_keys = allDiscreteKeys(); + KeySet discrete_keys = discreteKeys(); for (auto &factor : factors_) { for (const DiscreteKey &k : factor->discreteKeys()) { discrete_keys.insert(k.first); diff --git a/gtsam/hybrid/HybridGaussianISAM.cpp b/gtsam/hybrid/HybridGaussianISAM.cpp index 1a95c0c93..57e50104d 100644 --- a/gtsam/hybrid/HybridGaussianISAM.cpp +++ b/gtsam/hybrid/HybridGaussianISAM.cpp @@ -63,12 +63,7 @@ void HybridGaussianISAM::updateInternal( factors += boost::make_shared >(orphan); // Get all the discrete keys from the factors - KeySet allDiscrete; - for (auto& factor : factors) { - for (auto& k : factor->discreteKeys()) { - allDiscrete.insert(k.first); - } - } + KeySet allDiscrete = factors.discreteKeys(); // Create KeyVector with continuous keys followed by discrete keys. KeyVector newKeysDiscreteLast;