Lines Matching refs:bits

43  * is no way to access the internal bits (which I need for speed)
45 * Consider defining set degree. Without access to the bits, I must
49 * than this.bits.length.
54 protected final static int BITS = 64; // number of bits / long
64 /** The actual data bits */
65 protected long bits[];
67 /** Construct a bitset of size one word (64 bits) */
74 bits = bits_;
78 * @param nbits The size of the bitset in bits
81 bits = new long[((nbits - 1) >> LOG_BITS) + 1];
89 //System.out.println("bits.length "+bits.length);
90 if (n >= bits.length) {
93 bits[n] |= bitMask(el);
158 int min = Math.min(bits.length, a.bits.length);
160 bits[i] &= a.bits[i];
162 // clear all bits in this not present in a (if this bigger than a).
163 for (int i = min; i < bits.length; i++) {
164 bits[i] = 0;
174 for (int i = bits.length - 1; i >= 0; i--) {
175 bits[i] = 0;
181 if (n >= bits.length) { // grow as necessary to accommodate
184 bits[n] &= ~bitMask(el);
191 s.bits = new long[bits.length];
192 System.arraycopy(bits, 0, s.bits, 0, bits.length);
202 for (int i = bits.length - 1; i >= 0; i--) {
203 long word = bits[i];
222 int n = Math.min(this.bits.length, otherSet.bits.length);
224 // for any bits in common, compare
226 if (this.bits[i] != otherSet.bits[i]) {
231 // make sure any extra bits are off
233 if (this.bits.length > n) {
234 for (int i = n+1; i<this.bits.length; i++) {
235 if (this.bits[i] != 0) {
240 else if (otherSet.bits.length > n) {
241 for (int i = n+1; i<otherSet.bits.length; i++) {
242 if (otherSet.bits[i] != 0) {
252 * Grows the set to a larger number of bits.
256 int newSize = Math.max(bits.length << 1, numWordsToHold(bit));
258 System.arraycopy(bits, 0, newbits, 0, bits.length);
259 bits = newbits;
264 if (n >= bits.length) return false;
265 return (bits[n] & bitMask(el)) != 0;
272 for (int i = 0; i < (bits.length << LOG_BITS); i++) {
281 for (int i = bits.length - 1; i >= 0; i--) {
282 if (bits[i] != 0) return false;
301 for (int i = bits.length - 1; i >= 0; i--) {
302 bits[i] = ~bits[i];
306 /** complement bits in the range 0..maxBit. */
311 /** complement bits in the range minBit..maxBit.*/
317 bits[n] ^= bitMask(i);
365 s.bits[n] |= bitMask(i);
385 if (a.bits.length > bits.length) {
386 setSize(a.bits.length);
388 int min = Math.min(bits.length, a.bits.length);
390 bits[i] |= a.bits[i];
397 if (n >= bits.length) {
400 bits[n] &= ~bitMask(el);
409 int n = Math.min(nwords, bits.length);
410 System.arraycopy(bits, 0, newbits, 0, n);
411 bits = newbits;
415 return bits.length << LOG_BITS; // num words * bits per word
418 /** return how much space is being used by the bits array not
419 * how many actually have member bits on.
422 return bits.length;
432 * Basically, just turn off all bits of 'this' that are in 'a'.
436 // for all words of 'a', turn off corresponding bits of 'this'
437 for (int i = 0; i < bits.length && i < a.bits.length; i++) {
438 bits[i] &= ~a.bits[i];
457 for (int i = 0; i < (bits.length << LOG_BITS); i++) {
466 return bits;
483 for (int i = 0; i < (bits.length << LOG_BITS); i++) {
512 for (int i = 0; i < (bits.length << LOG_BITS); i++) {
538 for (int i = 0; i < bits.length; i++) {
540 long tmp = bits[i];
545 tmp = bits[i] >>> 32;
559 for (int i = 0; i < bits.length; i++) {
561 s.append(bits[i]);