isl_tab_pip.c: same_solution: return isl_bool
[isl.git] / isl_pw_hash.c
blob4d121c0798669f2505072ac368b1cbe1f72e8f3f
1 /*
2 * Copyright 2016 Sven Verdoolaege
4 * Use of this software is governed by the MIT license
6 * Written by Sven Verdoolaege
7 */
9 #include <isl_pw_macro.h>
10 #include <isl/hash.h>
12 /* Return a hash value that digests "pw".
14 uint32_t FN(PW,get_hash)(__isl_keep PW *pw)
16 int i;
17 uint32_t hash;
19 if (!pw)
20 return 0;
22 hash = isl_hash_init();
23 for (i = 0; i < pw->n; ++i) {
24 uint32_t set_hash, el_hash;
26 set_hash = isl_set_get_hash(pw->p[i].set);
27 isl_hash_hash(hash, set_hash);
28 el_hash = FN(EL,get_hash)(pw->p[i].FIELD);
29 isl_hash_hash(hash, el_hash);
32 return hash;