private ResidualIntIterator(final BVGraph g, final InputBitStream ibs, final int residualCount, final int x) { this.g = g; this.remaining = residualCount; this.ibs = ibs; try { this.next = (int)(x + Fast.nat2int(g.readLongResidual(ibs))); } catch (IOException e) { throw new RuntimeException(e); } }
public int read( final InputBitStream ibs ) throws IOException { final long readBits = ibs.readBits(); value = (int)Fast.nat2int( ibs.readLongDelta() ); unset = false; return (int)( ibs.readBits() - readBits ); }
public int read( final InputBitStream ibs ) throws IOException { final long readBits = ibs.readBits(); secondsFromEpoch = Fast.nat2int( ibs.readLongDelta() ); return (int)( ibs.readBits() - readBits ); }
public int read( final InputBitStream ibs ) throws IOException { final long readBits = ibs.readBits(); value = (int)Fast.nat2int( ibs.readLongDelta() ); unset = false; return (int)( ibs.readBits() - readBits ); }
public int read( final InputBitStream ibs ) throws IOException { final long readBits = ibs.readBits(); secondsFromEpoch = Fast.nat2int( ibs.readLongDelta() ); return (int)( ibs.readBits() - readBits ); }
public int read( final InputBitStream ibs ) throws IOException { final long readBits = ibs.readBits(); secondsFromEpoch = Fast.nat2int( ibs.readLongDelta() ); return (int)( ibs.readBits() - readBits ); }
public int read( final InputBitStream ibs ) throws IOException { final long readBits = ibs.readBits(); secondsFromEpoch = Fast.nat2int( ibs.readLongDelta() ); return (int)( ibs.readBits() - readBits ); }
public void get( long idx, float[] result, int offset ) { long endpoint = endpoints.get( idx ); FastInputBitStream ibs = new FastInputBitStream( vectorStreams ); ibs.position( endpoint ); for( int col = 0; col < vectorSize; ++col ) { int val = Fast.nat2int( ibs.readGolomb( golombModuli[ col ] ) ); result[ offset + col ] = ( ( ( float ) val ) + 0.5f * Integer.signum( val ) ) / quantizationFactor; } }
public int read( final InputBitStream ibs ) throws IOException { final long readBits = ibs.readBits(); value = (int)Fast.nat2int( ibs.readLongDelta() ); unset = false; return (int)( ibs.readBits() - readBits ); }
public int read( final InputBitStream ibs ) throws IOException { final long readBits = ibs.readBits(); value = (int)Fast.nat2int( ibs.readLongDelta() ); unset = false; return (int)( ibs.readBits() - readBits ); }
public int[] getInt( long idx ) { int[] ret = new int[ vectorSize ]; long endpoint = endpoints.get( idx ); FastInputBitStream ibs = new FastInputBitStream( vectorStreams ); ibs.position( endpoint ); for( int col = 0; col < vectorSize; ++col ) { ret[ col ] = Fast.nat2int( ibs.readGolomb( golombModuli[ col ] ) ); } return ret; }
quantumBitLength += Fast.nat2int( ibs.readDelta() ); entryBitLength += Fast.nat2int( ibs.readDelta() ); towerLength = entryBitLength * ( s + 1 ) + Fast.nat2int( ibs.readDelta() ); if ( DEBUG ) System.err.println( "{" + this + "} Tower length=" + towerLength ); if ( DEBUG ) System.err.println( "{" + this + "} Truncated--reading tops" ); pointerSkip[ s ] = Fast.nat2int( ibs.readGolomb( towerTopB[ s ], towerTopLog2B[ s ] ) ) + pointerPrediction[ s ]; bitSkip[ s ] = quantumBitLength * ( 1L << s ) + entryBitLength * ( ( 1L << s + 1 ) - s - 2 ) + Fast.nat2int( ibs.readLongDelta() ); pointerSkip[ i ] = Fast.nat2int( ibs.readGolomb( towerLowerB[ i ], towerLowerLog2B[ i ] ) ) + pointerSkip[ i + 1 ] / 2; bitSkip[ i ] = ( bitSkip[ i + 1 ] - entryBitLength * ( i + 1 ) ) / 2 - Fast.nat2int( ibs.readLongDelta() ); if ( DEBUG ) if ( currentDocument + pointerSkip[ i ] <= pointer ) System.err.println( "{" + this + "} stopping reading at i=" + i + " as currentDocument (" + currentDocument + ") plus pointer skip (" + pointerSkip[ i ] + ") is smaller than or equal target (" + pointer +")" ); if ( currentDocument + pointerSkip[ i ] <= pointer ) break;
quantumBitLength += Fast.nat2int( ibs.readDelta() ); entryBitLength += Fast.nat2int( ibs.readDelta() ); towerLength = entryBitLength * ( s + 1 ) + Fast.nat2int( ibs.readDelta() ); if ( DEBUG ) System.err.println( "{" + this + "} Tower length=" + towerLength ); if ( DEBUG ) System.err.println( "{" + this + "} Truncated--reading tops" ); pointerSkip[ s ] = Fast.nat2int( ibs.readGolomb( towerTopB[ s ], towerTopLog2B[ s ] ) ) + pointerPrediction[ s ]; bitSkip[ s ] = quantumBitLength * ( 1 << s ) + entryBitLength * ( ( 1 << s + 1 ) - s - 2 ) + Fast.nat2int( ibs.readLongDelta() ); pointerSkip[ i ] = Fast.nat2int( ibs.readGolomb( towerLowerB[ i ], towerLowerLog2B[ i ] ) ) + pointerSkip[ i + 1 ] / 2; bitSkip[ i ] = ( bitSkip[ i + 1 ] - entryBitLength * ( i + 1 ) ) / 2 - Fast.nat2int( ibs.readLongDelta() ); if ( DEBUG ) if ( currentDocument + pointerSkip[ i ] <= pointer ) System.err.println( "{" + this + "} stopping reading at i=" + i + " as currentDocument (" + currentDocument + ") plus pointer skip (" + pointerSkip[ i ] + ") is smaller than or equal target (" + pointer +")" ); if ( currentDocument + pointerSkip[ i ] <= pointer ) break;
quantumBitLength += Fast.nat2int( ibs.readDelta() ); positionsQuantumBitLength += Fast.nat2int( ibs.readDelta() ); entryBitLength += Fast.nat2int( ibs.readDelta() ); towerLength = entryBitLength * ( s + 1 ) + Fast.nat2int( ibs.readDelta() ); if ( DEBUG ) System.err.println( "{" + this + "} Tower length=" + towerLength ); if ( DEBUG ) System.err.println( "{" + this + "} Truncated--reading tops" ); pointerSkip[ s ] = Fast.nat2int( ibs.readGolomb( towerTopB[ s ], towerTopLog2B[ s ] ) ) + pointerPrediction[ s ]; bitSkip[ s ] = quantumBitLength * ( 1L << s ) + entryBitLength * ( ( 1L << s + 1 ) - s - 2 ) + Fast.nat2int( ibs.readLongDelta() ); positionsBitSkip[ s ] = positionsQuantumBitLength * ( 1L << s ) + Fast.nat2int( ibs.readLongDelta() ); pointerSkip[ i ] = Fast.nat2int( ibs.readGolomb( towerLowerB[ i ], towerLowerLog2B[ i ] ) ) + pointerSkip[ i + 1 ] / 2; bitSkip[ i ] = ( bitSkip[ i + 1 ] - entryBitLength * ( i + 1 ) ) / 2 - Fast.nat2int( ibs.readLongDelta() ); positionsBitSkip[ i ] = positionsBitSkip[ i + 1 ] / 2 - Fast.nat2int( ibs.readLongDelta() ); if ( DEBUG ) if ( currentDocument + pointerSkip[ i ] <= pointer ) System.err.println( "{" + this + "} stopping reading at i=" + i + " as currentDocument (" + currentDocument + ") plus pointer skip (" + pointerSkip[ i ] + ") is smaller than or equal target (" + pointer + ")" );
quantumBitLength += Fast.nat2int( ibs.readDelta() ); entryBitLength += Fast.nat2int( ibs.readDelta() ); towerLength = entryBitLength * ( s + 1 ) + Fast.nat2int( ibs.readDelta() ); if ( DEBUG ) System.err.println( "{" + this + "} Tower length=" + towerLength ); if ( DEBUG ) System.err.println( "{" + this + "} Truncated--reading tops" ); pointerSkip[ s ] = Fast.nat2int( ibs.readGolomb( towerTopB[ s ], towerTopLog2B[ s ] ) ) + pointerPrediction[ s ]; bitSkip[ s ] = quantumBitLength * ( 1L << s ) + entryBitLength * ( ( 1L << s + 1 ) - s - 2 ) + Fast.nat2int( ibs.readLongDelta() ); pointerSkip[ i ] = Fast.nat2int( ibs.readGolomb( towerLowerB[ i ], towerLowerLog2B[ i ] ) ) + pointerSkip[ i + 1 ] / 2; bitSkip[ i ] = ( bitSkip[ i + 1 ] - entryBitLength * ( i + 1 ) ) / 2 - Fast.nat2int( ibs.readLongDelta() ); if ( DEBUG ) if ( currentDocument + pointerSkip[ i ] <= pointer ) System.err.println( "{" + this + "} stopping reading at i=" + i + " as currentDocument (" + currentDocument + ") plus pointer skip (" + pointerSkip[ i ] + ") is smaller than or equal target (" + pointer +")" ); if ( currentDocument + pointerSkip[ i ] <= pointer ) break;
quantumBitLength += Fast.nat2int( ibs.readDelta() ); entryBitLength += Fast.nat2int( ibs.readDelta() ); towerLength = entryBitLength * ( s + 1 ) + Fast.nat2int( ibs.readDelta() ); if ( DEBUG ) System.err.println( "{" + this + "} Tower length=" + towerLength ); if ( DEBUG ) System.err.println( "{" + this + "} Truncated--reading tops" ); pointerSkip[ s ] = Fast.nat2int( ibs.readGolomb( towerTopB[ s ], towerTopLog2B[ s ] ) ) + pointerPrediction[ s ]; bitSkip[ s ] = quantumBitLength * ( 1 << s ) + entryBitLength * ( ( 1 << s + 1 ) - s - 2 ) + Fast.nat2int( ibs.readLongDelta() ); pointerSkip[ i ] = Fast.nat2int( ibs.readGolomb( towerLowerB[ i ], towerLowerLog2B[ i ] ) ) + pointerSkip[ i + 1 ] / 2; bitSkip[ i ] = ( bitSkip[ i + 1 ] - entryBitLength * ( i + 1 ) ) / 2 - Fast.nat2int( ibs.readLongDelta() ); if ( DEBUG ) if ( currentDocument + pointerSkip[ i ] <= pointer ) System.err.println( "{" + this + "} stopping reading at i=" + i + " as currentDocument (" + currentDocument + ") plus pointer skip (" + pointerSkip[ i ] + ") is smaller than or equal target (" + pointer +")" ); if ( currentDocument + pointerSkip[ i ] <= pointer ) break;
quantumBitLength += Fast.nat2int( ibs.readDelta() ); positionsQuantumBitLength += Fast.nat2int( ibs.readDelta() ); entryBitLength += Fast.nat2int( ibs.readDelta() ); towerLength = entryBitLength * ( s + 1 ) + Fast.nat2int( ibs.readDelta() ); if ( DEBUG ) System.err.println( "{" + this + "} Tower length=" + towerLength ); if ( DEBUG ) System.err.println( "{" + this + "} Truncated--reading tops" ); pointerSkip[ s ] = Fast.nat2int( ibs.readGolomb( towerTopB[ s ], towerTopLog2B[ s ] ) ) + pointerPrediction[ s ]; bitSkip[ s ] = quantumBitLength * ( 1 << s ) + entryBitLength * ( ( 1 << s + 1 ) - s - 2 ) + Fast.nat2int( ibs.readLongDelta() ); positionsBitSkip[ s ] = positionsQuantumBitLength * ( 1 << s ) + Fast.nat2int( ibs.readLongDelta() ); pointerSkip[ i ] = Fast.nat2int( ibs.readGolomb( towerLowerB[ i ], towerLowerLog2B[ i ] ) ) + pointerSkip[ i + 1 ] / 2; bitSkip[ i ] = ( bitSkip[ i + 1 ] - entryBitLength * ( i + 1 ) ) / 2 - Fast.nat2int( ibs.readLongDelta() ); positionsBitSkip[ i ] = positionsBitSkip[ i + 1 ] / 2 - Fast.nat2int( ibs.readLongDelta() ); if ( DEBUG ) if ( currentDocument + pointerSkip[ i ] <= pointer ) System.err.println( "{" + this + "} stopping reading at i=" + i + " as currentDocument (" + currentDocument + ") plus pointer skip (" + pointerSkip[ i ] + ") is smaller than or equal target (" + pointer + ")" );
quantumBitLength += Fast.nat2int( ibs.readDelta() ); entryBitLength += Fast.nat2int( ibs.readDelta() ); towerLength = entryBitLength * ( s + 1 ) + Fast.nat2int( ibs.readDelta() ); if ( DEBUG ) System.err.println( "{" + this + "} Tower length=" + towerLength ); if ( DEBUG ) System.err.println( "{" + this + "} Truncated--reading tops" ); pointerSkip[ s ] = Fast.nat2int( ibs.readGolomb( towerTopB[ s ], towerTopLog2B[ s ] ) ) + pointerPrediction[ s ]; bitSkip[ s ] = quantumBitLength * ( 1 << s ) + entryBitLength * ( ( 1 << s + 1 ) - s - 2 ) + Fast.nat2int( ibs.readLongDelta() ); pointerSkip[ i ] = Fast.nat2int( ibs.readGolomb( towerLowerB[ i ], towerLowerLog2B[ i ] ) ) + pointerSkip[ i + 1 ] / 2; bitSkip[ i ] = ( bitSkip[ i + 1 ] - entryBitLength * ( i + 1 ) ) / 2 - Fast.nat2int( ibs.readLongDelta() ); if ( DEBUG ) if ( currentDocument + pointerSkip[ i ] <= pointer ) System.err.println( "{" + this + "} stopping reading at i=" + i + " as currentDocument (" + currentDocument + ") plus pointer skip (" + pointerSkip[ i ] + ") is smaller than or equal target (" + pointer +")" ); if ( currentDocument + pointerSkip[ i ] <= pointer ) break;
quantumBitLength += Fast.nat2int( ibs.readDelta() ); entryBitLength += Fast.nat2int( ibs.readDelta() ); towerLength = entryBitLength * ( s + 1 ) + Fast.nat2int( ibs.readDelta() ); if ( DEBUG ) System.err.println( "{" + this + "} Tower length=" + towerLength ); if ( DEBUG ) System.err.println( "{" + this + "} Truncated--reading tops" ); pointerSkip[ s ] = Fast.nat2int( ibs.readGolomb( towerTopB[ s ], towerTopLog2B[ s ] ) ) + pointerPrediction[ s ]; bitSkip[ s ] = quantumBitLength * ( 1L << s ) + entryBitLength * ( ( 1L << s + 1 ) - s - 2 ) + Fast.nat2int( ibs.readLongDelta() ); pointerSkip[ i ] = Fast.nat2int( ibs.readGolomb( towerLowerB[ i ], towerLowerLog2B[ i ] ) ) + pointerSkip[ i + 1 ] / 2; bitSkip[ i ] = ( bitSkip[ i + 1 ] - entryBitLength * ( i + 1 ) ) / 2 - Fast.nat2int( ibs.readLongDelta() ); if ( DEBUG ) if ( currentDocument + pointerSkip[ i ] <= pointer ) System.err.println( "{" + this + "} stopping reading at i=" + i + " as currentDocument (" + currentDocument + ") plus pointer skip (" + pointerSkip[ i ] + ") is smaller than or equal target (" + pointer +")" ); if ( currentDocument + pointerSkip[ i ] <= pointer ) break;
left[0] = prev = (int)(Fast.nat2int(ibs.readLongGamma()) + x); len[0] = ibs.readGamma() + minIntervalLength;