diff --git a/gtsam/inference/BayesNet-inl.h b/gtsam/inference/BayesNet-inl.h index 633beb7f8..8e26affb6 100644 --- a/gtsam/inference/BayesNet-inl.h +++ b/gtsam/inference/BayesNet-inl.h @@ -84,8 +84,8 @@ namespace gtsam { /* ************************************************************************* */ template - list BayesNet::ordering() const { - list ord; + FastList BayesNet::ordering() const { + FastList ord; BOOST_FOREACH(sharedConditional conditional,conditionals_) ord.push_back(conditional->key()); return ord; diff --git a/gtsam/inference/BayesNet.h b/gtsam/inference/BayesNet.h index f5b6ddc8a..c77b23c76 100644 --- a/gtsam/inference/BayesNet.h +++ b/gtsam/inference/BayesNet.h @@ -20,6 +20,7 @@ #pragma once #include +#include #include #include @@ -107,7 +108,7 @@ namespace gtsam { } /** return keys in reverse topological sort order, i.e., elimination order */ - std::list ordering() const; + FastList ordering() const; /** SLOW O(n) random access to Conditional by key */ sharedConditional operator[](Index key) const; diff --git a/gtsam/inference/JunctionTree-inl.h b/gtsam/inference/JunctionTree-inl.h index 4ce33da41..913ec9967 100644 --- a/gtsam/inference/JunctionTree-inl.h +++ b/gtsam/inference/JunctionTree-inl.h @@ -114,7 +114,7 @@ namespace gtsam { if(bayesClique) { // create a new clique in the junction tree - list frontals = bayesClique->ordering(); + FastList frontals = bayesClique->ordering(); sharedClique clique(new Clique(frontals.begin(), frontals.end(), bayesClique->separator_.begin(), bayesClique->separator_.end())); // count the factors for this cluster to pre-allocate space diff --git a/gtsam/inference/inference.h b/gtsam/inference/inference.h index 1eab0c276..00b381201 100644 --- a/gtsam/inference/inference.h +++ b/gtsam/inference/inference.h @@ -36,9 +36,6 @@ namespace gtsam { /* Static members only, private constructor */ Inference() {} - // Internal version that actually calls colamd after the constraint set is created in the right format - static Permutation::shared_ptr PermutationCOLAMD_(const VariableIndex& variableIndex, std::vector& cmember); - public: /** @@ -52,6 +49,11 @@ namespace gtsam { template static Permutation::shared_ptr PermutationCOLAMD(const VariableIndex& variableIndex, const CONSTRAINED& constrainLast); + /** + * Compute a CCOLAMD permutation using the constraint groups in cmember. + */ + static Permutation::shared_ptr PermutationCOLAMD_(const VariableIndex& variableIndex, std::vector& cmember); + }; /* ************************************************************************* */