use PredecessorMap instead of map<Key,Key>

release/4.3a0
Kai Ni 2010-01-14 05:24:20 +00:00
parent 8562c00a52
commit 1519d029dc
2 changed files with 3 additions and 3 deletions

View File

@ -272,7 +272,7 @@ void FactorGraph<Factor>::associateFactor(int index, sharedFactor factor) {
/* ************************************************************************* */ /* ************************************************************************* */
template<class Factor> template <class Key> template<class Factor> template <class Key>
map<Key,Key> FactorGraph<Factor>::findMinimumSpanningTree() const { PredecessorMap<Key> FactorGraph<Factor>::findMinimumSpanningTree() const {
SDGraph<Key> g = gtsam::toBoostGraph<FactorGraph<Factor>, sharedFactor, Key>(*this); SDGraph<Key> g = gtsam::toBoostGraph<FactorGraph<Factor>, sharedFactor, Key>(*this);
@ -281,7 +281,7 @@ map<Key,Key> FactorGraph<Factor>::findMinimumSpanningTree() const {
prim_minimum_spanning_tree(g, &p_map[0]); prim_minimum_spanning_tree(g, &p_map[0]);
// convert edge to string pairs // convert edge to string pairs
map<Key, Key> tree; PredecessorMap<Key> tree;
typename SDGraph<Key>::vertex_iterator itVertex = boost::vertices(g).first; typename SDGraph<Key>::vertex_iterator itVertex = boost::vertices(g).first;
typename vector<typename SDGraph<Key>::Vertex>::iterator vi; typename vector<typename SDGraph<Key>::Vertex>::iterator vi;
for (vi = p_map.begin(); vi!=p_map.end(); itVertex++, vi++) { for (vi = p_map.begin(); vi!=p_map.end(); itVertex++, vi++) {

View File

@ -120,7 +120,7 @@ namespace gtsam {
/** /**
* find the minimum spanning tree. * find the minimum spanning tree.
*/ */
template<class Key> std::map<Key, Key> findMinimumSpanningTree() const; template<class Key> PredecessorMap<Key> findMinimumSpanningTree() const;
/** /**
* Split the graph into two parts: one corresponds to the given spanning tre, * Split the graph into two parts: one corresponds to the given spanning tre,