Fast and simple SumTree implementation in Rust
Reason this release was yanked:
Bug when adding in full tree
Project description
SumTree
This module contains a SumTree implementation in Rust with Python wrappers. Speedup is around 10x in comparison to an equivalent full Python implementation.
Check the project on github: https://github.com/yamoling/sumtree
Usage
Initialisation
from sumtree import SumTree
st = SumTree(1024)
st.add(10)
print(st.total) # 10
print(len(st)) # 1
print(st.capacity) # 1024
Sampling data
from sumtree import SumTree
st = SumTree(1024)
for i in range(1024):
st.add(i)
index, value = st.get(500)
print(index, value) # 32, 32.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
sumtree-0.1.3.tar.gz
(6.0 kB
view hashes)
Built Distribution
Close
Hashes for sumtree-0.1.3-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 274abe6d9b3725f992fc87b9dcbbebaf309b9aac7ba40e10c53a24de69b4960b |
|
MD5 | d5326b32f8b5cbbc1115435af6e7a00c |
|
BLAKE2b-256 | 4a42caa741507025caafa4a19946a4247495ded0fea9c621f075476bfc35e76f |