static final EWAHCompressedBitmap ones(int sizeInBits) { EWAHCompressedBitmap mask = new EWAHCompressedBitmap(); mask.addStreamOfEmptyWords( true, sizeInBits / EWAHCompressedBitmap.WORD_IN_BITS); int remaining = sizeInBits % EWAHCompressedBitmap.WORD_IN_BITS; if (remaining > 0) mask.addWord((1L << remaining) - 1, remaining); return mask; } }
final EWAHCompressedBitmap toEWAHCompressedBitmap() { EWAHCompressedBitmap compressed = new EWAHCompressedBitmap( words.length); int runningEmptyWords = 0; long lastNonEmptyWord = 0; for (long word : words) { if (word == 0) { runningEmptyWords++; continue; } if (lastNonEmptyWord != 0) compressed.addWord(lastNonEmptyWord); if (runningEmptyWords > 0) { compressed.addStreamOfEmptyWords(false, runningEmptyWords); runningEmptyWords = 0; } lastNonEmptyWord = word; } int bitsThatMatter = 64 - Long.numberOfLeadingZeros(lastNonEmptyWord); if (bitsThatMatter > 0) compressed.addWord(lastNonEmptyWord, bitsThatMatter); return compressed; }
static final EWAHCompressedBitmap ones(int sizeInBits) { EWAHCompressedBitmap mask = new EWAHCompressedBitmap(); mask.addStreamOfEmptyWords( true, sizeInBits / EWAHCompressedBitmap.wordinbits); int remaining = sizeInBits % EWAHCompressedBitmap.wordinbits; if (remaining > 0) mask.add((1L << remaining) - 1, remaining); return mask; } }
static final EWAHCompressedBitmap ones(int sizeInBits) { EWAHCompressedBitmap mask = new EWAHCompressedBitmap(); mask.addStreamOfEmptyWords( true, sizeInBits / EWAHCompressedBitmap.WORD_IN_BITS); int remaining = sizeInBits % EWAHCompressedBitmap.WORD_IN_BITS; if (remaining > 0) mask.addWord((1L << remaining) - 1, remaining); return mask; } }
final EWAHCompressedBitmap toEWAHCompressedBitmap() { EWAHCompressedBitmap compressed = new EWAHCompressedBitmap( words.length); int runningEmptyWords = 0; long lastNonEmptyWord = 0; for (long word : words) { if (word == 0) { runningEmptyWords++; continue; } if (lastNonEmptyWord != 0) compressed.add(lastNonEmptyWord); if (runningEmptyWords > 0) { compressed.addStreamOfEmptyWords(false, runningEmptyWords); runningEmptyWords = 0; } lastNonEmptyWord = word; } int bitsThatMatter = 64 - Long.numberOfLeadingZeros(lastNonEmptyWord); if (bitsThatMatter > 0) compressed.add(lastNonEmptyWord, bitsThatMatter); return compressed; }
final EWAHCompressedBitmap toEWAHCompressedBitmap() { EWAHCompressedBitmap compressed = new EWAHCompressedBitmap( words.length); int runningEmptyWords = 0; long lastNonEmptyWord = 0; for (long word : words) { if (word == 0) { runningEmptyWords++; continue; } if (lastNonEmptyWord != 0) compressed.addWord(lastNonEmptyWord); if (runningEmptyWords > 0) { compressed.addStreamOfEmptyWords(false, runningEmptyWords); runningEmptyWords = 0; } lastNonEmptyWord = word; } int bitsThatMatter = 64 - Long.numberOfLeadingZeros(lastNonEmptyWord); if (bitsThatMatter > 0) compressed.addWord(lastNonEmptyWord, bitsThatMatter); return compressed; }
int fullwords = b / WORD_IN_BITS; int shift = b % WORD_IN_BITS; answer.addStreamOfEmptyWords(false, fullwords); if (shift == 0) { answer.buffer.push_back(this.buffer, 0, sz); answer.addStreamOfEmptyWords(i.getRunningBit(), rl - 1);
int fullwords = b / WORD_IN_BITS; int shift = b % WORD_IN_BITS; answer.addStreamOfEmptyWords(false, fullwords); if (shift == 0) { answer.buffer.push_back(this.buffer, 0, sz); answer.addStreamOfEmptyWords(i.getRunningBit(), rl - 1);
this.addStreamOfEmptyWords(defaultValue, (size / WORD_IN_BITS) - (this.sizeInBits / WORD_IN_BITS) );
this.addStreamOfEmptyWords(defaultValue, (size / WORD_IN_BITS) - (this.sizeInBits / WORD_IN_BITS) );