bitmaps

module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 21, 2022 License: MIT

README

bitmaps

This has two bitmap implementations capable of holding a fixed size bitmap of nbits.

Fixed

Fixed is a fixed size bitmap stored an array of uint64 capable of holding nbits of data.

Boring

Boring is a single roaring bitmap container capable of holding nbits of data. The data is held either as an array of uint16 (for each bit set), or as fixed size bitmap of uint64.

The implementation always allocates a fixed sized buffer which is either used to store the array list, or is used to store the bitmap. The buffer is never reallocated.

One the array data grows over half the container the container is switched to a bitmap form.

The implementation is pretty complicated because it must be capable doing all operations with both bitmaps and array lists.

Marshaled format

Both bitmap implementation support the same marshalled format, which is

8 byte header | data

The header is:

4 byte magic number
1 byte encoding
1 byte padding
2 byte cardinality

The data is either an array of uint16, or nbits of encoded bitmap.

The marshalled format is not portable, and is encoded in whatever the native endian-ness of the host.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL