diff --git a/DataStructures/BinaryHeap.h b/DataStructures/BinaryHeap.h index 00304f23a..c332eadc8 100644 --- a/DataStructures/BinaryHeap.h +++ b/DataStructures/BinaryHeap.h @@ -28,9 +28,7 @@ or see http://www.gnu.org/licenses/agpl.txt. #include #include #include -#include -#include -#include +#include template< typename NodeID, typename Key > class ArrayStorage { @@ -74,10 +72,10 @@ private: }; template< typename NodeID, typename Key > -class DenseStorage { +class UnorderedMapStorage { public: - DenseStorage( size_t size = 0 ) { nodes.set_empty_key(UINT_MAX); } + UnorderedMapStorage( size_t size = 0 ) { } Key &operator[]( NodeID node ) { return nodes[node]; @@ -88,34 +86,7 @@ public: } private: - google::dense_hash_map< NodeID, Key > nodes; -}; - -template< typename NodeID, typename Key > -class SparseStorage { -public: - - SparseStorage( size_t size = 0 ) { } - - Key &operator[]( NodeID node ) { - return nodes[node]; - } - - void Clear() { - nodes.clear(); - } - -private: - google::sparse_hash_map< NodeID, Key > nodes; -}; - -template< typename NodeID, typename Key > -class SparseTableStorage : public google::sparsetable { -public: - SparseTableStorage(size_t n) : google::sparsetable(n){ } - void Clear() { - google::sparsetable::clear(); - } + boost::unordered_map< NodeID, Key > nodes; }; template diff --git a/DataStructures/LRUCache.h b/DataStructures/LRUCache.h index c3b65d5e4..2bee8dd21 100644 --- a/DataStructures/LRUCache.h +++ b/DataStructures/LRUCache.h @@ -1,9 +1,10 @@ #include -#include #include #include #include +#include + template < class T > struct Countfn { unsigned long operator()( const T &x ) { return 1; } @@ -17,7 +18,7 @@ public: typedef std::vector< Key > Key_List; ///< List of keys typedef typename Key_List::iterator Key_List_Iter; ///< Main cache iterator typedef typename Key_List::const_iterator Key_List_cIter; ///< Main cache iterator (const) - typedef google::sparse_hash_map< Key, List_Iter > Map; ///< Index typedef + typedef boost::unordered_map< Key, List_Iter > Map; ///< Index typedef typedef std::pair< Key, List_Iter > Pair; ///< Pair of Map elements typedef typename Map::iterator Map_Iter; ///< Index iterator typedef typename Map::const_iterator Map_cIter; ///< Index iterator (const) @@ -29,9 +30,7 @@ private: unsigned long _curr_size; ///< Current abstract size of the cache public: - LRUCache( const unsigned long Size ) : _max_size( Size ), _curr_size( 0 ) { - _index.set_deleted_key(UINT_MAX); - } + LRUCache( const unsigned long Size ) : _max_size( Size ), _curr_size( 0 ) { } ~LRUCache() { clear(); }