move renamed allDiscreteKeys and allContinuousKeys to HybridFactorGraph
parent
aebcde99e2
commit
9ef5c184ec
|
@ -135,6 +135,28 @@ class HybridFactorGraph : public FactorGraph<HybridFactor> {
|
|||
push_hybrid(p);
|
||||
}
|
||||
}
|
||||
|
||||
/// Get all the discrete keys in the factor graph.
|
||||
const KeySet allDiscreteKeys() const {
|
||||
KeySet discrete_keys;
|
||||
for (auto& factor : factors_) {
|
||||
for (const DiscreteKey& k : factor->discreteKeys()) {
|
||||
discrete_keys.insert(k.first);
|
||||
}
|
||||
}
|
||||
return discrete_keys;
|
||||
}
|
||||
|
||||
/// Get all the continuous keys in the factor graph.
|
||||
const KeySet allContinuousKeys() const {
|
||||
KeySet keys;
|
||||
for (auto& factor : factors_) {
|
||||
for (const Key& key : factor->continuousKeys()) {
|
||||
keys.insert(key);
|
||||
}
|
||||
}
|
||||
return keys;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace gtsam
|
||||
|
|
|
@ -404,31 +404,9 @@ void HybridGaussianFactorGraph::add(DecisionTreeFactor::shared_ptr factor) {
|
|||
FactorGraph::add(boost::make_shared<HybridDiscreteFactor>(factor));
|
||||
}
|
||||
|
||||
/* ************************************************************************ */
|
||||
const KeySet HybridGaussianFactorGraph::getDiscreteKeys() const {
|
||||
KeySet discrete_keys;
|
||||
for (auto &factor : factors_) {
|
||||
for (const DiscreteKey &k : factor->discreteKeys()) {
|
||||
discrete_keys.insert(k.first);
|
||||
}
|
||||
}
|
||||
return discrete_keys;
|
||||
}
|
||||
|
||||
/* ************************************************************************ */
|
||||
const KeySet HybridGaussianFactorGraph::getContinuousKeys() const {
|
||||
KeySet keys;
|
||||
for (auto &factor : factors_) {
|
||||
for (const Key &key : factor->continuousKeys()) {
|
||||
keys.insert(key);
|
||||
}
|
||||
}
|
||||
return keys;
|
||||
}
|
||||
|
||||
/* ************************************************************************ */
|
||||
const Ordering HybridGaussianFactorGraph::getHybridOrdering() const {
|
||||
KeySet discrete_keys = getDiscreteKeys();
|
||||
KeySet discrete_keys = allDiscreteKeys();
|
||||
for (auto &factor : factors_) {
|
||||
for (const DiscreteKey &k : factor->discreteKeys()) {
|
||||
discrete_keys.insert(k.first);
|
||||
|
|
|
@ -161,12 +161,6 @@ class GTSAM_EXPORT HybridGaussianFactorGraph
|
|||
}
|
||||
}
|
||||
|
||||
/// Get all the discrete keys in the factor graph.
|
||||
const KeySet getDiscreteKeys() const;
|
||||
|
||||
/// Get all the continuous keys in the factor graph.
|
||||
const KeySet getContinuousKeys() const;
|
||||
|
||||
/**
|
||||
* @brief Return a Colamd constrained ordering where the discrete keys are
|
||||
* eliminated after the continuous keys.
|
||||
|
|
Loading…
Reference in New Issue