MimIR
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
gid.h
Go to the documentation of this file.
1#pragma once
2
3#include <unordered_map>
4#include <unordered_set>
5
6#include <ankerl/unordered_dense.h>
7
8namespace mim {
9
10template<class T>
11struct GIDHash {
12 using is_avalanching = void;
13
14 size_t operator()(T p) const noexcept { return ankerl::unordered_dense::hash<decltype(p->gid())>{}(p->gid()); }
15};
16
17template<class T>
18struct GIDLt {
19 constexpr bool operator()(T a, T b) const noexcept { return a->gid() < b->gid(); }
20};
21
22// clang-format off
23/// @name GID
24///@{
25template<class K, class V> using GIDMap = ankerl::unordered_dense::map<K, V, GIDHash<K>>;
26template<class K> using GIDSet = ankerl::unordered_dense::set<K, GIDHash<K>>;
27template<class K, class V> using GIDNodeMap = std::unordered_map<K, V, GIDHash<K>>;
28template<class K> using GIDNodeSet = std::unordered_set<K, GIDHash<K>>;
29///@}
30// clang-format on
31
32} // namespace mim
Definition ast.h:16
ankerl::unordered_dense::map< K, V, GIDHash< K > > GIDMap
Definition gid.h:25
std::unordered_set< K, GIDHash< K > > GIDNodeSet
Definition gid.h:28
ankerl::unordered_dense::set< K, GIDHash< K > > GIDSet
Definition gid.h:26
std::unordered_map< K, V, GIDHash< K > > GIDNodeMap
Definition gid.h:27
size_t operator()(T p) const noexcept
Definition gid.h:14
void is_avalanching
Definition gid.h:12
constexpr bool operator()(T a, T b) const noexcept
Definition gid.h:19