More use of FastList, FastSet

release/4.3a0
Richard Roberts 2011-02-08 01:36:51 +00:00
parent 12664813d4
commit 5b3000fe0a
4 changed files with 10 additions and 7 deletions

View File

@ -84,8 +84,8 @@ namespace gtsam {
/* ************************************************************************* */
template<class CONDITIONAL>
list<Index> BayesNet<CONDITIONAL>::ordering() const {
list<Index> ord;
FastList<Index> BayesNet<CONDITIONAL>::ordering() const {
FastList<Index> ord;
BOOST_FOREACH(sharedConditional conditional,conditionals_)
ord.push_back(conditional->key());
return ord;

View File

@ -20,6 +20,7 @@
#pragma once
#include <gtsam/base/types.h>
#include <gtsam/base/FastList.h>
#include <gtsam/base/Testable.h>
#include <gtsam/inference/Permutation.h>
@ -107,7 +108,7 @@ namespace gtsam {
}
/** return keys in reverse topological sort order, i.e., elimination order */
std::list<Index> ordering() const;
FastList<Index> ordering() const;
/** SLOW O(n) random access to Conditional by key */
sharedConditional operator[](Index key) const;

View File

@ -114,7 +114,7 @@ namespace gtsam {
if(bayesClique) {
// create a new clique in the junction tree
list<Index> frontals = bayesClique->ordering();
FastList<Index> 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

View File

@ -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<int>& cmember);
public:
/**
@ -52,6 +49,11 @@ namespace gtsam {
template<typename CONSTRAINED>
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<int>& cmember);
};
/* ************************************************************************* */