# lib/bit-vector.jsx

## mixin BitVector.<T>

### abstract function clear() : void

Clears bit-vector.

### abstract function build() : void

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

### function size() : int

It returns bit-vector length

### function size0() : int

It returns number of 0 bit in bit-vector.

### function size1() : int

It returns number of 1 bit in bit-vector.

### abstract function set0(pos : int) : void

### abstract function set1(pos : int) : void

### function get(value : int) : boolean

### function rank0(i : int) : int

### function rank1(i : int) : int

### function select0(i : int) : int

### function select1(i : int) : int

### abstract function dump(output : BinaryOutput) : void

### abstract function load(input : BinaryInput) : void

## 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