diff options
author | Ulrich Bauer <mail@ulrich-bauer.org> | 2019-05-22 21:18:42 +0200 |
---|---|---|
committer | Ulrich Bauer <mail@ulrich-bauer.org> | 2019-05-22 21:18:42 +0200 |
commit | 3f5478ce251e3984a76e281440e957ca1edd79cb (patch) | |
tree | b961e4373c8e6b4c40d2c500d06e5b52353d902e /ripser.cpp | |
parent | 840e337d8d57bfdf4a67f60d7b3ea3982715553b (diff) |
use google dense hash
Diffstat (limited to 'ripser.cpp')
-rw-r--r-- | ripser.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -55,9 +55,14 @@ #include <unordered_map> #ifdef USE_GOOGLE_HASHMAP -#include <sparsehash/sparse_hash_map> -template <class Key, class T> class hash_map : public google::sparse_hash_map<Key, T> { +#include <sparsehash/dense_hash_map> +template <class Key, class T> class hash_map : public google::dense_hash_map<Key, T> { public: + explicit hash_map() + : google::dense_hash_map<Key, T>() { + this->set_empty_key(-1); + } + inline void reserve(size_t hint) { this->resize(hint); } }; #else |