From 3d9e66c65f704117f862d4331f8c15e6b2851e2c Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Sun, 9 Jun 2024 09:07:06 +0200 Subject: [PATCH] wip --- CMakeLists.txt | 2 +- include/util/query_heap.hpp | 29 +---------------------------- unit_tests/util/query_heap.cpp | 5 ++--- 3 files changed, 4 insertions(+), 32 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3b3de8e4c4f..795ec06811d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -361,7 +361,7 @@ if(ENABLE_CONAN) KEEP_RPATHS NO_OUTPUT_DIRS OPTIONS boost:filesystem_version=3 # https://stackoverflow.com/questions/73392648/error-with-boost-filesystem-version-in-cmake - # onetbb:shared=${TBB_SHARED} + onetbb:shared=${TBB_SHARED} boost:without_stacktrace=True # Apple Silicon cross-compilation fails without it BUILD missing ) diff --git a/include/util/query_heap.hpp b/include/util/query_heap.hpp index 8ea7451465b..4a9c65b4897 100644 --- a/include/util/query_heap.hpp +++ b/include/util/query_heap.hpp @@ -31,36 +31,10 @@ template class ArrayStorage std::vector positions; }; -template class MapStorage -{ - public: - explicit MapStorage(std::size_t) {} - - Key &operator[](NodeID node) { return nodes[node]; } - - void Clear() { nodes.clear(); } - - Key peek_index(const NodeID node) const - { - const auto iter = nodes.find(node); - if (nodes.end() != iter) - { - return iter->second; - } - return std::numeric_limits::max(); - } - - private: - std::map nodes; -}; - template class UnorderedMapStorage { public: - explicit UnorderedMapStorage(std::size_t) - { - // nodes.rehash(1000); - } + explicit UnorderedMapStorage(std::size_t size) { nodes.reserve(size); } Key &operator[](const NodeID node) { return nodes[node]; } @@ -84,7 +58,6 @@ template class UnorderedMapStorage private: ankerl::unordered_dense::map nodes; - // std::unordered_map nodes; }; template , - MapStorage, - UnorderedMapStorage>; +using storage_types = + boost::mpl::list, UnorderedMapStorage>; template struct RandomDataFixture {