Line data Source code
1 : /*
2 : * Copyright 2016 Sven Verdoolaege
3 : *
4 : * Use of this software is governed by the MIT license
5 : *
6 : * Written by Sven Verdoolaege
7 : */
8 :
9 : #include <isl_multi_macro.h>
10 : #include <isl/hash.h>
11 :
12 : /* Return a hash value that digests "multi".
13 : */
14 0 : uint32_t FN(MULTI(BASE),get_hash)(__isl_keep MULTI(BASE) *multi)
15 : {
16 : int i;
17 : uint32_t hash;
18 :
19 0 : if (!multi)
20 0 : return 0;
21 :
22 0 : hash = isl_hash_init();
23 0 : for (i = 0; i < multi->n; ++i) {
24 : uint32_t el_hash;
25 0 : el_hash = FN(EL,get_hash)(multi->u.p[i]);
26 0 : isl_hash_hash(hash, el_hash);
27 : }
28 :
29 0 : return hash;
30 : }
|