| 191 | return (bytes[i/8] >> (i % 8)) & 1; |
| 192 | } |
| 193 | void set_bit(int i,unsigned int a) |
| 194 | { |
| 195 | if ((size_t)i >= nbits) |
| 196 | throw overflow("BitVector", i, nbits); |
| 197 | int j = i/8, k = i&7; |
| 198 | if (a==1) |
| 199 | { bytes[j] |= (octet)(1UL<<k); } |
| 200 | else |
| 201 | { bytes[j] &= (octet)~(1UL<<k); } |
| 202 | } |
| 203 | |
| 204 | void add(const BitVector& A, const BitVector& B) |
| 205 | { |