cvc4-1.4
gmp_util.h
Go to the documentation of this file.
1 /********************* */
18 #include "cvc4_public.h"
19 
20 #ifndef __CVC4__GMP_UTIL_H
21 #define __CVC4__GMP_UTIL_H
22 
23 #include <gmpxx.h>
24 
25 namespace CVC4 {
26 
28 inline size_t gmpz_hash(const mpz_t toHash) {
29  size_t hash = 0;
30  for (int i = 0, n = mpz_size(toHash); i < n; ++i){
31  mp_limb_t limb = mpz_getlimbn(toHash, i);
32  hash = hash * 2;
33  hash = hash xor limb;
34  }
35  return hash;
36 }/* gmpz_hash() */
37 
38 }/* CVC4 namespace */
39 
40 #endif /* __CVC4__GMP_UTIL_H */
Definition: options.h:76
size_t gmpz_hash(const mpz_t toHash)
Hashes the gmp integer primitive in a word by word fashion.
Definition: gmp_util.h:28
Macros that should be defined everywhere during the building of the libraries and driver binary...