31 const size_t BITSINLONG = 8 *
sizeof(uint32_t);
37 static inline void zero_all_bits(
BIT_VECTOR array,
size_t length) {
38 for (
size_t index = 0; index < length; index++) {
43 static inline void set_all_bits(
BIT_VECTOR array,
size_t length) {
44 for (
size_t index = 0; index < length; index++) {
50 for (
size_t index = 0; index < length; index++) {
51 dest[index] = source[index];
55 #define SET_BIT(array,bit) (array[bit/BITSINLONG]|=1<<(bit&(BITSINLONG-1)))
57 #define reset_bit(array,bit) (array[bit/BITSINLONG]&=~(1<<(bit&(BITSINLONG-1))))
59 #define test_bit(array,bit) (array[bit/BITSINLONG] & (1<<(bit&(BITSINLONG-1))))
61 static inline size_t WordsInVectorOfSize(
size_t NumBits) {
71 static inline void FreeBitVector(
BIT_VECTOR BitVector) {
84 static inline BIT_VECTOR NewBitVector(
size_t NumBits) {
85 return new uint32_t[WordsInVectorOfSize(NumBits)];