#ifndef BITVEC_H #define BITVEC_H #include #define BV_SUMMARY_WORDS 3 #define BV_SUMMARY_BITS (BV_SUMMARY_WORDS * 64) static inline int bitvec_n(int bits) { return (bits+BV_SUMMARY_BITS+63)/64; } static inline unsigned long long *bitvec_slab_alloc(int n) { return slab_alloc(sizeof(unsigned long long)*n); } // r = 0 static inline void bitvec_clear_all(unsigned long long *r, int n) { bzero(r, sizeof(unsigned long long)*n); } // r = a & b static inline int bitvec_and(unsigned long long *a, unsigned long long *b, unsigned long long *r, int n) { int i, nz=0; if(r)for(i=0;i>32); return __builtin_popcount(x1) + __builtin_popcount(x2); } static inline int bitvec_three_way_or_count(unsigned long long *a, unsigned long long *b, unsigned long long *c, int n) { int i, C = 0; for(i=BV_SUMMARY_WORDS;i