Пример #1
0
 BoundingBox ReturnSubvolume(uint index) {
   std::bitset<D> bitindex(index);
   vec_t center = center_, halfSpace = half_space_ / 2;
   for (int i = 0;i < D; ++i)
     center(i) += halfSpace(i) * (bitindex[i] ? 1 : -1);
   return BoundingBox(center,halfSpace);
 }
Пример #2
0
int get_bit(bitarray *arr, int b) { 
  return arr->words[bitindex(b)] >> bitoffset(b)  &  0x1;
}
Пример #3
0
void clear_bit(bitarray *arr, int b) { 
    arr->words[bitindex(b)] &= ~(1 << (bitoffset(b)));
}
Пример #4
0
void set_bit(bitarray * arr,int b) { 
    arr->words[bitindex(b)] |= 1 << (bitoffset(b)); 
}
Пример #5
0
int get_bit(char *arr, int b) { 
  return arr[bitindex(b)] >> bitoffset(b)  &  0x1;
}
Пример #6
0
void clear_bit(char *arr, int b) { 
    arr[bitindex(b)] &= ~(1 << (bitoffset(b)));
}
Пример #7
0
void set_bit(char * arr,int b) { 
    arr[bitindex(b)] |= 1 << (bitoffset(b)); 
}