35 #define WORD_OFFSET(n) (n/64) 36 #define BIT_OFFSET(n) (n & 0x3f) 43 BitMap() { start = NULL; end = NULL;};
46 uint64_t num_longs = (size + 63) / 64;
48 start =
new uint64_t[num_longs]();
49 end = start + num_longs;
57 uint64_t num_longs = rhs.end - rhs.start;
59 start =
new uint64_t[num_longs];
60 end = start + num_longs;
61 std::copy(rhs.start, rhs.end, start);
68 uint64_t num_longs = rhs.end - rhs.start;
70 start =
new uint64_t[num_longs];
71 end = start + num_longs;
72 std::copy(rhs.start, rhs.end, start);
80 for(uint64_t *it=start; it!=end; it++)
119 uint64_t temp = (*it);
120 if (bit_offset != 63) {
121 temp = temp >> (bit_offset+1);
126 next = (next & 0xffffffc0);
150 std::copy(other->start, other->end, start);
154 uint64_t max_size = (end-start)*64;
155 for (uint64_t i=0; i<max_size; i++)
157 std::cout <<
" " << i;
158 std::cout << std::endl;
void copy_from(const BitMap *other)
bool get_bit(uint64_t pos)
long get_next_bit(uint64_t pos)
BitMap(const BitMap &rhs)
void set_bit_atomic(long pos)
BitMap & operator=(const BitMap &rhs)
void reset_bit(uint64_t pos)
void set_bit(uint64_t pos)