/** * Decompress a compressed block into an integer array * * @param compBlock the compressed input block * @param blockSize the block size which is 256 by default * @return the decompressed output block */ public int decompressOneBlock(int[] decompBlock, int[] compBlock, int blockSize) { return PForDelta.decompressOneBlock(decompBlock, compBlock, blockSize); } }
private void printSet() { for (int i = 0; i < _blockSize; i++) { PForDelta.decompressOneBlock(iterDecompBlock, sequenceOfCompBlocks.get(i), _blockSize); postProcessBlock(iterDecompBlock, _blockSize); System.out.print(iterDecompBlock + ","); } }
private void printSet() { for (int i = 0; i < _blockSize; i++) { PForDelta.decompressOneBlock(iterDecompBlock, sequenceOfCompBlocks.get(i), _blockSize); postProcessBlock(iterDecompBlock, _blockSize); System.out.print(iterDecompBlock + ","); } }
/** * Find the first element that is equal to or larger than the target in the (startBlockIndex)th compressed block * Before this function is called, baseListForOnlyCompBlock must not be empty and the target must be able to be found in this function, otherwise something must be wrong * */ private int advanceToTargetInTheFollowingCompBlocks(int target, int startBlockIndex) { // searching from the current block int iterBlockIndex = binarySearchInBaseListForBlockThatMayContainTarget(baseListForOnlyCompBlocks, startBlockIndex, baseListForOnlyCompBlocks.size()-1, target); if(iterBlockIndex < 0) { System.err.println("ERROR: advanceToTargetInTheFollowingCompBlocks(): Impossible, we must be able to find the block"); } PForDelta.decompressOneBlock(iterDecompBlock, sequenceOfCompBlocks.get(iterBlockIndex), _blockSize); postProcessBlock(iterDecompBlock, _blockSize); int offset = binarySearchForFirstElementEqualOrLargerThanTarget(iterDecompBlock, 0, _blockSize-1, target); //int offset = searchForFirstElementEqualOrLargerThanTarget(iterDecompBlock, 0, _blockSize-1, target); if(offset < 0) { System.err.println("ERROR: case 2: advanceToTargetInTheFollowingCompBlocks(), Impossible, we must be able to find the target" + target + " in the block " + iterBlockIndex); } cursor = (iterBlockIndex << BLOCK_INDEX_SHIFT_BITS) + offset; return iterDecompBlock[offset]; }
/** * Find the first element that is equal to or larger than the target in the (startBlockIndex)th compressed block * Before this function is called, baseListForOnlyCompBlock must not be empty and the target must be able to be found in this function, otherwise something must be wrong * */ private int advanceToTargetInTheFollowingCompBlocks(int target, int startBlockIndex) { // searching from the current block int iterBlockIndex = binarySearchInBaseListForBlockThatMayContainTarget(baseListForOnlyCompBlocks, startBlockIndex, baseListForOnlyCompBlocks.size()-1, target); if(iterBlockIndex < 0) { System.err.println("ERROR: advanceToTargetInTheFollowingCompBlocks(): Impossible, we must be able to find the block"); } PForDelta.decompressOneBlock(iterDecompBlock, sequenceOfCompBlocks.get(iterBlockIndex), _blockSize); postProcessBlock(iterDecompBlock, _blockSize); int offset = binarySearchForFirstElementEqualOrLargerThanTarget(iterDecompBlock, 0, _blockSize-1, target); //int offset = searchForFirstElementEqualOrLargerThanTarget(iterDecompBlock, 0, _blockSize-1, target); if(offset < 0) { System.err.println("ERROR: case 2: advanceToTargetInTheFollowingCompBlocks(), Impossible, we must be able to find the target" + target + " in the block " + iterBlockIndex); } cursor = (iterBlockIndex << BLOCK_INDEX_SHIFT_BITS) + offset; return iterDecompBlock[offset]; }
PForDelta.decompressOneBlock(iterDecompBlock, sequenceOfCompBlocks.get(iterBlockIndex), _blockSize); lastAccessedDocId = iterDecompBlock[0]; if (lastAccessedDocId >= target)
PForDelta.decompressOneBlock(iterDecompBlock, sequenceOfCompBlocks.get(iterBlockIndex), _blockSize); lastAccessedDocId = iterDecompBlock[0]; if (lastAccessedDocId >= target)
@Override public void headlessUncompress(int[] in, IntWrapper inpos, int inlength, int[] out, IntWrapper outpos, int num) { num = Util.greatestMultiple(num, BLOCK_SIZE); if (num > 0) { int d = PForDelta.decompressOneBlock(out, in, num); inpos.add(d / 32); outpos.add(num); } }
@Override public void headlessUncompress(int[] in, IntWrapper inpos, int inlength, int[] out, IntWrapper outpos, int num) { num = Util.greatestMultiple(num, BLOCK_SIZE); if (num > 0) { int d = PForDelta.decompressOneBlock(out, in, num); inpos.add(d / 32); outpos.add(num); } }
PForDelta.decompressOneBlock(iterDecompBlock, sequenceOfCompBlocks.get(iterBlockIndex), _blockSize); lastAccessedDocId = iterDecompBlock[offset];
PForDelta.decompressOneBlock(tmpbuf, compbuf, 128); tmpbuf[0] += deltaoffset;
PForDelta.decompressOneBlock(tmpbuf, compbuf, 128); tmpbuf[0] += deltaoffset;
PForDelta.decompressOneBlock(iterDecompBlock, sequenceOfCompBlocks.get(iterBlockIndex), _blockSize); lastAccessedDocId = iterDecompBlock[offset];
PForDelta.decompressOneBlock(myDecompBlock, sequenceOfCompBlocks.get(iterDecompBlock), _blockSize);
PForDelta.decompressOneBlock(myDecompBlock, sequenceOfCompBlocks.get(iterDecompBlock), _blockSize);