diff --git a/gtsam/inference/MetisIndex-inl.h b/gtsam/inference/MetisIndex-inl.h index 646523372..672036373 100644 --- a/gtsam/inference/MetisIndex-inl.h +++ b/gtsam/inference/MetisIndex-inl.h @@ -44,7 +44,7 @@ void MetisIndex::augment(const FACTORGRAPH& factors) { for(const Key& key: *factors[i]) { keySet.insert(keySet.end(), key); // Keep a track of all unique keys if (intKeyBMap_.left.find(key) == intKeyBMap_.left.end()) { - intKeyBMap_.insert(bm_type::value_type(key, keyCounter)); + intKeyBMap_.insert(key, keyCounter); keyCounter++; } } diff --git a/gtsam/inference/MetisIndex.h b/gtsam/inference/MetisIndex.h index 4b1f3dfce..abdf11c5f 100644 --- a/gtsam/inference/MetisIndex.h +++ b/gtsam/inference/MetisIndex.h @@ -22,17 +22,9 @@ #include #include -// Boost bimap generates many ugly warnings in CLANG -#ifdef __clang__ -# pragma clang diagnostic push -# pragma clang diagnostic ignored "-Wredeclared-class-member" -#endif -#include -#ifdef __clang__ -# pragma clang diagnostic pop -#endif - #include +#include +#include namespace gtsam { /** @@ -45,12 +37,21 @@ namespace gtsam { class GTSAM_EXPORT MetisIndex { public: typedef std::shared_ptr shared_ptr; - typedef boost::bimap bm_type; private: + // Stores Key <-> integer value relationship + struct BiMap { + std::map left; + std::unordered_map right; + void insert(const Key& left_value, const int32_t& right_value) { + left[left_value] = right_value; + right[right_value] = left_value; + } + }; + std::vector xadj_; // Index of node's adjacency list in adj std::vector adj_; // Stores ajacency lists of all nodes, appended into a single vector - boost::bimap intKeyBMap_; // Stores Key <-> integer value relationship + BiMap intKeyBMap_; // Stores Key <-> integer value relationship size_t nKeys_; public: