19 len = (bits%8) ? (bits/8+1) : (bits/8);
20 vector =
new char[len];
23 vector[i] = vector[i] & 0;
34 for (
int i=0; i<num_of_bits; i++)
35 num += (
int)(.5 + pow(2, i)*
readbit(i));
44 lback = (lthis>lx) ? lthis : lx;
47 for (i=0; i<lback; i++)
57 for (
int i=0; i<len; i++) {
58 if ((vector[i] & vector2[i]) != vector[i]) {
72 for (
int i=len-1; i>-1; i--) {
73 vector[i] = vector[i] << 1;
82 printf(
"Bitvektor: (");
83 for (i=0; i<num_of_bits; i++)
89 int byte, idx, bitcode;
90 if (pos > num_of_bits)
94 bitcode = (
int) pow(2, idx);
95 vector[byte] = vector[byte] | bitcode;
100 int byte, idx, bitcode;
101 if (pos > num_of_bits)
105 bitcode = (
int) pow(2, idx);
107 vector[byte] = vector[byte] ^ bitcode;
112 int byte, idx, bitcode;
113 if (pos > num_of_bits)
117 bitcode = (
int) pow(2, idx);
118 if (vector[byte] & bitcode)
int subset(Bitvector *Obermenge)
const char * get_vector()
Bitvector * merge(Bitvector *x)