pyEliasFano offers a **quasi-succinct** represenation for a monotone non-decreasing sequence of n integers from the universe [0 . . . m) occupying 2*n+n*ceil(log2(m/n)) bits.
Project description
pyEliasFano
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.
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
import pyEliasFano as EF
imports the module.
integers = sorted([123, 1343, 2141, 35312, 4343434])
ef = EF.EliasFano(integers)
creates an Elias-Fano structure for the sorted integers
list.
ef.select(2)
returns the integer stored at index position 2
.
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 4
.
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.4761443},
version = {0.0.1},
publisher = {Zenodo},
url = {https://github.com/rmrschub/pyEliasFano}
}
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
Built Distribution
File details
Details for the file pyEliasFano-0.0.2.tar.gz
.
File metadata
- Download URL: pyEliasFano-0.0.2.tar.gz
- Upload date:
- Size: 10.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd14e0401aae0124b1637f98cddea9365547c32819e1c83ec011dc26cdafaf36 |
|
MD5 | 74194bce4ca5565ee80006359b5f9cf2 |
|
BLAKE2b-256 | 76856d8955c040782f5fb1f99976423f53ee2277d1a3f7a9c7d50335b0b92ddb |
File details
Details for the file pyEliasFano-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: pyEliasFano-0.0.2-py3-none-any.whl
- Upload date:
- Size: 10.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e649fc1de3007283213aed7fb9bc45390f97b625b4c14a9437acc9d7d1c866a5 |
|
MD5 | ed545cb2dced0e95db46fee1271e01c4 |
|
BLAKE2b-256 | 326145ed4eb0ca1956a6533fb2c7ce37f04fb4cad8a84925ef8b24ec17a3e7f8 |