This commit is contained in:
Siarhei Fedartsou 2024-06-09 10:39:20 +02:00
parent 2e3f3e90ef
commit 9398bbc382
3 changed files with 3 additions and 31 deletions

View File

@ -361,7 +361,7 @@ if(ENABLE_CONAN)
KEEP_RPATHS KEEP_RPATHS
NO_OUTPUT_DIRS NO_OUTPUT_DIRS
OPTIONS boost:filesystem_version=3 # https://stackoverflow.com/questions/73392648/error-with-boost-filesystem-version-in-cmake 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 boost:without_stacktrace=True # Apple Silicon cross-compilation fails without it
BUILD missing BUILD missing
) )

View File

@ -31,36 +31,10 @@ template <typename NodeID, typename Key> class ArrayStorage
std::vector<Key> positions; std::vector<Key> positions;
}; };
template <typename NodeID, typename Key> 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<Key>::max();
}
private:
std::map<NodeID, Key> nodes;
};
template <typename NodeID, typename Key> class UnorderedMapStorage template <typename NodeID, typename Key> class UnorderedMapStorage
{ {
public: public:
explicit UnorderedMapStorage(std::size_t) explicit UnorderedMapStorage(std::size_t)
{
// nodes.rehash(1000);
}
Key &operator[](const NodeID node) { return nodes[node]; } Key &operator[](const NodeID node) { return nodes[node]; }
@ -84,7 +58,6 @@ template <typename NodeID, typename Key> class UnorderedMapStorage
private: private:
ankerl::unordered_dense::map<NodeID, Key> nodes; ankerl::unordered_dense::map<NodeID, Key> nodes;
// std::unordered_map<NodeID, Key> nodes;
}; };
template <typename NodeID, template <typename NodeID,

View File

@ -22,9 +22,8 @@ struct TestData
using TestNodeID = NodeID; using TestNodeID = NodeID;
using TestKey = int; using TestKey = int;
using TestWeight = int; using TestWeight = int;
using storage_types = boost::mpl::list<ArrayStorage<TestNodeID, TestKey>, using storage_types =
MapStorage<TestNodeID, TestKey>, boost::mpl::list<ArrayStorage<TestNodeID, TestKey>, UnorderedMapStorage<TestNodeID, TestKey>>;
UnorderedMapStorage<TestNodeID, TestKey>>;
template <unsigned NUM_ELEM> struct RandomDataFixture template <unsigned NUM_ELEM> struct RandomDataFixture
{ {