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 <ankerl/unordered_dense.h>
4
5namespace mim {
6
7template<class T>
8struct GIDHash {
9 using is_avalanching = void;
10
11 size_t operator()(T p) const noexcept { return ankerl::unordered_dense::hash<decltype(p->gid())>{}(p->gid()); }
12};
13
14template<class T>
15struct GIDLt {
16 constexpr bool operator()(T a, T b) const noexcept { return a->gid() < b->gid(); }
17};
18
19// clang-format off
20/// @name GID
21///@{
22template<class K, class V> using GIDMap = ankerl::unordered_dense::map<K, V, GIDHash<K>>;
23template<class K> using GIDSet = ankerl::unordered_dense::set<K, GIDHash<K>>;
24template<class K > using GIDNodeSet = ankerl::unordered_dense::segmented_set<K, GIDHash<K>>;
25template<class K, class V> using GIDNodeMap = ankerl::unordered_dense::segmented_map<K, V, GIDHash<K>>;
26///@}
27// clang-format on
28
29} // namespace mim
Definition ast.h:16
ankerl::unordered_dense::map< K, V, GIDHash< K > > GIDMap
Definition gid.h:22
ankerl::unordered_dense::segmented_set< K, GIDHash< K > > GIDNodeSet
Definition gid.h:24
ankerl::unordered_dense::set< K, GIDHash< K > > GIDSet
Definition gid.h:23
ankerl::unordered_dense::segmented_map< K, V, GIDHash< K > > GIDNodeMap
Definition gid.h:25
size_t operator()(T p) const noexcept
Definition gid.h:11
void is_avalanching
Definition gid.h:9
constexpr bool operator()(T a, T b) const noexcept
Definition gid.h:16