GCC Code Coverage Report


Directory: src/
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 0.0% 0 / 0 / 8
Functions: 0.0% 0 / 0 / 2
Branches: 0.0% 0 / 0 / 4

hash_map.hpp
Line Branch Exec Source
1 #pragma once
2
3 #include <bits/stdc++.h>
4 // #include<bits/extc++.h>
5 #include <ext/pb_ds/assoc_container.hpp>
6
7 namespace wala {
8
9 struct splitmix64_hash {
10 ✗ static uint64_t splitmix64(uint64_t x) {
11 // http://xorshift.di.unimi.it/splitmix64.c
12 ✗ x += 0x9e3779b97f4a7c15;
13 ✗ x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
14 ✗ x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
15 ✗ return x ^ (x >> 31);
16 }
17
18 ✗ size_t operator()(uint64_t x) const {
19 ✗ static const uint64_t FIXED_RANDOM = std::chrono::steady_clock::now().time_since_epoch().count();
20 ✗ return splitmix64(x + FIXED_RANDOM);
21 }
22 };
23
24 template <typename K, typename V, typename Hash = splitmix64_hash>
25 using hash_map = __gnu_pbds::gp_hash_table<K, V, Hash>;
26
27 template <typename K, typename Hash = splitmix64_hash>
28 using hash_set = hash_map<K, __gnu_pbds::null_type, Hash>;
29
30 } // namespace wala
31