Skip to main content

pyEliasFano offers quasi-succinct represenations for monotone non-decreasing sequences of integers.

Project description

pyEliasFano

DOI

pyEliasFano offers a quasi-succinct represenation for a monotone non-decreasing sequence of n integers from the universe [0 . . . m) occupying 2n+nceil(log2(m/n)) bits.

by Antonio Mallia, 2018

It supports the following operations:

  • select(k): nearly constant time access to the k-th element,
  • rank(x): access to the index within the structure for given integer x.
  • nextGEQ(x): fast access to the smallest integer of the sequence that is greater or equal than a given x
  • nextLEQ(x): fast access to the largest integer of the sequence that is smaller or equal than a given x

Installation

pip install pyEliasFano

Usage

from pyEliasFano import EliasFano

imports the module.

integers = sorted([123, 1343, 2141, 35312, 4343434])
ef = EliasFano(integers)

creates an Elias-Fano structure for the sorted integers list. Note that indexing in EliasFano structures is 1-based!

Rank and Select

ef.select(3)

returns the integer stored at index position 3. Here we get 2141.

ef.rank(4343434)

returns the index position for the given integer if stored within the Elias-Fano structure. Here, we get 5.

nextGEQ and nextLEQ

ef.nextGEQ(1345)

returns the smallest integer stored in the Elias-Fano structure that is larger than the given integer.

ef.nextLEQ(4343420)

returns the largest integer stored in the Elias-Fano structure that is smaller than the given integer. Here, we get 35312.

Citation

@misc{rmrschub_2021_pyEliasFano,
    author       = {René Schubotz},
    title        = {{pyEliasFano: Quasi-succinct represenations for monotone non-decreasing sequences of integers.}},
    month        = may,
    year         = 2021,
    doi          = {10.5281/zenodo.4774741},
    version      = {0.0.6},
    publisher    = {Zenodo},
    url          = {https://github.com/rmrschub/pyEliasFano}
    }

License

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyEliasFano-0.0.7.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

pyEliasFano-0.0.7-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file pyEliasFano-0.0.7.tar.gz.

File metadata

  • Download URL: pyEliasFano-0.0.7.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for pyEliasFano-0.0.7.tar.gz
Algorithm Hash digest
SHA256 e3e0032b27a72e7ce68457410305e921c64d7ac6cb78cf7d74e5001f87718675
MD5 d3d6f4c7c3405229445249d33dadc395
BLAKE2b-256 41f908ae7aad5e2250180daddd4c8a743a9dd7796008314d580175df969952ef

See more details on using hashes here.

File details

Details for the file pyEliasFano-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: pyEliasFano-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for pyEliasFano-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 1a818536a5d97be04fd06e579c9e16f2d112b075af0cb424c3bb5e9f82a1fc51
MD5 e81ceffbf642b31fe0dc12d635be6e37
BLAKE2b-256 1d46f60fa7c96577e9292c08c6eda912651e81797cfb75e178c92799703a9197

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page