lib/bit-vector.jsx

class ArrayBitVector

new ArrayBitVector()

Constructor for bit vector based on int[]. This version resizes length automatically, but each only memory efficiency is 50%. This is JavaScript limitation because it has only 64bit floating point number and it uses only 32bit part as integer.

override function clear() : void

Clears bit vector.

override function build() : void

Precalculates rank() number. It should be called before using select() and rank().

override function set0(value : int) : void

Clear bit.
value The position you want to operate.

override function set1(value : int) : void

Set bit.
value The position you want to operate.

override function dump(output : BinaryOutput) : void

override function load(input : BinaryInput) : void

class Uint32BitVector

new Uint32BitVector(size : int)

Constructor for bit vector based on Uint32bitVector. This version is fixed size, but memory efficiency is better than `ArrayBitVector`.
size BitVector size

override function clear() : void

Clears bit vector.

override function build() : void

Precalculates rank() number. It should be called before using select() and rank().

override function set1(value : int) : void

Sets bit.
value The position you want to operate.

override function set0(value : int) : void

Clears bit.
value The position you want to operate.

override function dump(output : BinaryOutput) : void

override function load(input : BinaryInput) : void