Skip to content

Commit 4f9c518

Browse files
committed
use robin-hood-hashing
1 parent 91d3dc7 commit 4f9c518

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "cpp/external_projects/robin-hood-hashing"]
2+
path = cpp/external_projects/robin-hood-hashing
3+
url = https://github.com/martinus/robin-hood-hashing

cpp/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ clean:
44
rm main
55

66
main: src/main.cpp
7-
clang++ -std=c++17 -O3 -Wall -Wextra -pedantic-errors -march=native -mtune=native -o main src/main.cpp
7+
clang++ -std=c++17 -O3 -Wall -Wextra -pedantic-errors -march=native -mtune=native -I external_projects/robin-hood-hashing/src/include -o main src/main.cpp
Submodule robin-hood-hashing added at 900e809

cpp/src/main.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include<queue>
77
#include<cstdint>
88
#include<limits>
9+
#include"robin_hood.h"
910

1011
using NodeId = int;
1112
using NodeIndex = int;
@@ -17,7 +18,7 @@ constexpr int DISTANCE_MULTIPLE = 100;
1718
bool is_debug = false;
1819

1920
struct G {
20-
std::unordered_map<NodeId,NodeIndex> id2idx;
21+
robin_hood::unordered_map<NodeId,NodeIndex> id2idx;
2122
std::vector<NodeId> idx2id = {0};
2223
NodeIndex idx = 1;
2324
std::vector<std::vector<Edge>> edge = {std::vector<Edge>()};

0 commit comments

Comments
 (0)