Skip to content

Commit

Permalink
use robin-hood-hashing
Browse files Browse the repository at this point in the history
  • Loading branch information
wx257osn2 committed Jun 22, 2020
1 parent 91d3dc7 commit 4f9c518
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "cpp/external_projects/robin-hood-hashing"]
path = cpp/external_projects/robin-hood-hashing
url = https://github.com/martinus/robin-hood-hashing
2 changes: 1 addition & 1 deletion cpp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ clean:
rm main

main: src/main.cpp
clang++ -std=c++17 -O3 -Wall -Wextra -pedantic-errors -march=native -mtune=native -o main src/main.cpp
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
1 change: 1 addition & 0 deletions cpp/external_projects/robin-hood-hashing
Submodule robin-hood-hashing added at 900e80
3 changes: 2 additions & 1 deletion cpp/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include<queue>
#include<cstdint>
#include<limits>
#include"robin_hood.h"

using NodeId = int;
using NodeIndex = int;
Expand All @@ -17,7 +18,7 @@ constexpr int DISTANCE_MULTIPLE = 100;
bool is_debug = false;

struct G {
std::unordered_map<NodeId,NodeIndex> id2idx;
robin_hood::unordered_map<NodeId,NodeIndex> id2idx;
std::vector<NodeId> idx2id = {0};
NodeIndex idx = 1;
std::vector<std::vector<Edge>> edge = {std::vector<Edge>()};
Expand Down

0 comments on commit 4f9c518

Please sign in to comment.