diff --git a/gtsam/inference/MetisIndex-inl.h b/gtsam/inference/MetisIndex-inl.h index 50bed2e3b..7299d7c8a 100644 --- a/gtsam/inference/MetisIndex-inl.h +++ b/gtsam/inference/MetisIndex-inl.h @@ -26,8 +26,8 @@ namespace gtsam { /* ************************************************************************* */ template void MetisIndex::augment(const FactorGraph& factors) { - std::map > iAdjMap; // Stores a set of keys that are adjacent to key x, with adjMap.first - std::map >::iterator iAdjMapIt; + std::map > iAdjMap; // Stores a set of keys that are adjacent to key x, with adjMap.first + std::map >::iterator iAdjMapIt; std::set keySet; /* ********** Convert to CSR format ********** */ @@ -36,7 +36,7 @@ void MetisIndex::augment(const FactorGraph& factors) { // starting at index xadj[i] and ending at(but not including) // index xadj[i + 1](i.e., adjncy[xadj[i]] through // and including adjncy[xadj[i + 1] - 1]). - idx_t keyCounter = 0; + int32_t keyCounter = 0; // First: Record a copy of each key inside the factorgraph and create a // key to integer mapping. This is referenced during the adjaceny step @@ -58,7 +58,7 @@ void MetisIndex::augment(const FactorGraph& factors) { BOOST_FOREACH(const Key& k1, *factors[i]) BOOST_FOREACH(const Key& k2, *factors[i]) if (k1 != k2) { - // Store both in Key and idx_t format + // Store both in Key and int32_t format int i = intKeyBMap_.left.at(k1); int j = intKeyBMap_.left.at(k2); iAdjMap[i].insert(iAdjMap[i].end(), j); @@ -71,14 +71,14 @@ void MetisIndex::augment(const FactorGraph& factors) { xadj_.push_back(0); // Always set the first index to zero for (iAdjMapIt = iAdjMap.begin(); iAdjMapIt != iAdjMap.end(); ++iAdjMapIt) { - std::vector temp; + std::vector temp; // Copy from the FastSet into a temporary vector std::copy(iAdjMapIt->second.begin(), iAdjMapIt->second.end(), std::back_inserter(temp)); // Insert each index's set in order by appending them to the end of adj_ adj_.insert(adj_.end(), temp.begin(), temp.end()); //adj_.push_back(temp); - xadj_.push_back((idx_t) adj_.size()); + xadj_.push_back((int32_t) adj_.size()); } } diff --git a/gtsam/inference/MetisIndex.h b/gtsam/inference/MetisIndex.h index 51624e29e..22b03ee5d 100644 --- a/gtsam/inference/MetisIndex.h +++ b/gtsam/inference/MetisIndex.h @@ -22,7 +22,6 @@ #include #include #include -#include // Boost bimap generates many ugly warnings in CLANG #ifdef __clang__ @@ -47,13 +46,13 @@ namespace gtsam { class GTSAM_EXPORT MetisIndex { public: typedef boost::shared_ptr shared_ptr; - typedef boost::bimap bm_type; + typedef boost::bimap bm_type; private: - FastVector xadj_; // Index of node's adjacency list in adj - FastVector adj_; // Stores ajacency lists of all nodes, appended into a single vector - FastVector iadj_; // Integer keys for passing into metis. One to one mapping with adj_; - boost::bimap intKeyBMap_; // Stores Key <-> integer value relationship + FastVector xadj_; // Index of node's adjacency list in adj + FastVector adj_; // Stores ajacency lists of all nodes, appended into a single vector + FastVector iadj_; // Integer keys for passing into metis. One to one mapping with adj_; + boost::bimap intKeyBMap_; // Stores Key <-> integer value relationship size_t nKeys_; public: @@ -84,16 +83,16 @@ public: template void augment(const FactorGraph& factors); - std::vector xadj() const { + std::vector xadj() const { return xadj_; } - std::vector adj() const { + std::vector adj() const { return adj_; } size_t nValues() const { return nKeys_; } - Key intToKey(idx_t value) const { + Key intToKey(int32_t value) const { assert(value >= 0); return intKeyBMap_.right.find(value)->second; }