public boolean set( final long index, final boolean value ) { return bitVector.set( from + index, value ); } public void set( final long index, final int value ) { set( index, value != 0 ); }
public boolean set( final long index, final boolean value ) { return bitVector.set( from + index, value ); } public void set( final long index, final int value ) { set( index, value != 0 ); }
@Override public boolean set(final long index, final boolean value) { ensureIndex(index); return bitVector.set(from + index, value); }
public long set( long index, long value ) { if ( width != Long.SIZE && value > fullMask ) throw new IllegalArgumentException(); long oldValue = getLong( index ); final long start = index * width; for( int i = width; i-- != 0; ) bitVector.set( i + start, ( value & 1L << i ) != 0 ); return oldValue; }
public long set( long index, long value ) { if ( width != Long.SIZE && value > fullMask ) throw new IllegalArgumentException(); long oldValue = getLong( index ); final long start = index * width; for( int i = width; i-- != 0; ) bitVector.set( i + start, ( value & 1L << i ) != 0 ); return oldValue; }
@Override public long set(long index, long value) { if (width != Long.SIZE && value > fullMask) throw new IllegalArgumentException(); long oldValue = getLong(index); final long start = index * width; for(int i = width; i-- != 0;) bitVector.set(i + start, (value & 1L << i) != 0); return oldValue; }
public boolean add( final long index ) { if ( index < 0 ) throw new IllegalArgumentException( "The provided index (" + index + ") is negative" ); if ( index < from || index >= to ) return false; final int size = bitVector.size(); if ( index >= size ) bitVector.length( index + 1 ); final boolean oldValue = bitVector.getBoolean( index ); bitVector.set( index ); return ! oldValue; }
public boolean add( final long index ) { if ( index < 0 ) throw new IllegalArgumentException( "The provided index (" + index + ") is negative" ); if ( index < from || index >= to ) return false; final int size = bitVector.size(); if ( index >= size ) bitVector.length( index + 1 ); final boolean oldValue = bitVector.getBoolean( index ); bitVector.set( index ); return ! oldValue; }
@Override public boolean add(final long index) { if (index < 0) throw new IllegalArgumentException("The provided index (" + index + ") is negative"); if (index < from || index >= to) return false; final long length = bitVector.length(); if (index >= length) bitVector.length(index + 1); final boolean oldValue = bitVector.getBoolean(index); bitVector.set(index); return ! oldValue; }
for( int j = l; j-- != 0; ) if ( ( 1L << j & value ) != 0 ) v.set( l - 1 - j ); codeWord[ s ] = v; longCodeWord[ s ] = value;
shortestCodeWord.set(i, ibs.readBit());
shortestCodeWord.set(i, ibs.readBit());
private static <K, V> Select sizesToSelect(final TableConfig<K, V> config, final File tempSizes, final long dataSize) throws IOException { final long numEntries = tempSizes.length() / 4; try (final MMapBuffer sizes = new MMapBuffer(tempSizes, 0L, numEntries * 4, FileChannel.MapMode.READ_ONLY, ByteOrder.nativeOrder())) { final DirectMemory sizesMemory = sizes.memory(); final long maxValue = config.compressOffset(dataSize, numEntries); final BitVector bits = LongArrayBitVector.ofLength(maxValue); for (long i = 0, offset = 0; i < numEntries; offset += sizesMemory.getInt(i * 4), ++i) { final long value = config.compressOffset(offset, i); bits.set(value); } return new HintedBsearchSelect(new Rank9(bits)); } }
if (pos < last) throw new IllegalArgumentException("Positions are not nondecreasing: " + pos + " < " + last); if (l != 0) lowerBitsList.set(i, pos & lowerLBitsMask); upperBits.set((pos >> l) + i); last = pos;
if (v > upperBound) throw new IllegalArgumentException("Too large value: " + v + " > " + upperBound); if (l != 0) lowerBitsList.set(i, v & lowerBitsMask); upperBitsVector.set((v >>> l) + i);
if (v < last) throw new IllegalArgumentException("Values are not nondecreasing: " + v + " < " + last); if (l != 0) lowerBitsList.set(i, v & lowerBitsMask); upperBits.set((v >>> l) + i); last = v;
/** Populates the codeword vector by scanning recursively * the decoding tree. * * @param node a subtree of the decoding tree. * @param prefix the path leading to <code>n</code>. */ private void buildCodes(final BitVector[] codeWord, final TreeDecoder.Node node, final BitVector prefix) { if (node instanceof TreeDecoder.LeafNode) { codeWord[((TreeDecoder.LeafNode)node).symbol] = prefix; return; } BitVector bitVector = prefix.copy(); bitVector.length(bitVector.length() + 1); buildCodes(codeWord, node.left, bitVector); bitVector = prefix.copy(); bitVector.length(bitVector.length() + 1); bitVector.set(bitVector.length() - 1); buildCodes(codeWord, node.right, bitVector); }
/** Populates the codeword vector by scanning recursively * the decoding tree. * * @param node a subtree of the decoding tree. * @param prefix the path leading to <code>n</code>. */ private void buildCodes( final BitVector[] codeWord, final TreeDecoder.Node node, final BitVector prefix ) { if ( node instanceof TreeDecoder.LeafNode ) { codeWord[ ((TreeDecoder.LeafNode)node).symbol ] = prefix; return; } BitVector bitVector = prefix.copy(); bitVector.length( bitVector.length() + 1 ); buildCodes( codeWord, node.left, bitVector ); bitVector = prefix.copy(); bitVector.length( bitVector.length() + 1 ); bitVector.set( bitVector.size() - 1 ); buildCodes( codeWord, node.right, bitVector ); }
/** Populates the codeword vector by scanning recursively * the decoding tree. * * @param node a subtree of the decoding tree. * @param prefix the path leading to <code>n</code>. */ private void buildCodes( final BitVector[] codeWord, final TreeDecoder.Node node, final BitVector prefix ) { if ( node instanceof TreeDecoder.LeafNode ) { codeWord[ ((TreeDecoder.LeafNode)node).symbol ] = prefix; return; } BitVector bitVector = prefix.copy(); bitVector.length( bitVector.length() + 1 ); buildCodes( codeWord, node.left, bitVector ); bitVector = prefix.copy(); bitVector.length( bitVector.length() + 1 ); bitVector.set( bitVector.size() - 1 ); buildCodes( codeWord, node.right, bitVector ); }
key.length(lastZero + 1).set(lastZero); final long pos = ranker.getLong(key);