Coder Social home page Coder Social logo

vigna / sux Goto Github PK

View Code? Open in Web Editor NEW
79.0 9.0 16.0 865 KB

Succinct data structures in C/C++

License: Other

C++ 97.82% Makefile 1.51% Python 0.67%
fenwick-trees ranking selection succinct-data-structure minimal-perfect-hash elias-fano cplusplus

sux's Introduction

Sux 1.0.3

Welcome to the C++ part of the Sux project.

Available classes

The classes we provide fall into three categories:

All classes are heavily asserted. For testing speed, remember to use -DNDEBUG.

Documentation can be generated by running doxygen.

All provided classes are templates, so you just have to copy the files in the sux directory somewhere in your include path.

Benchmarks

The commands make ranksel, make recsplit, make fenwick and make dynranksek will generate binaries in bin with which you can test the speed of RecSplit, rank/select static structures, compact Fenwick trees and dynamic rank/select structures. Note that you can set the make variable LEAF to change the leaf size of RecSplit, as in make recsplit LEAF=4, and the variable ALLOC_TYPE to the possible values of sux::util::AllocType to experiment, for example, with transparent huge pages on Linux.

For ranking and selection, we generate one binary for each type of structure, with some variation on parameters (see the makefile for more details). Beside the number of bits, you can provide one or two probabilities. Bits will be set to one with the given probability in the first half of the test array, and with the second probability in the second half (if no second probability is specified, it is assumed to be equal to the first one). This setup is necessary to show the slow behaviour of naive implementations on half-almost-empty-half-almost-full arrays.

For RecSplit, we provide dump/load binaries which dump on disk a minimal perfect hash function, and test it. The standard version uses a keys file for the keys, whereas the โ€œ128โ€ version uses 128-bit random keys. We suggest the latter for benchmarking as in any case the first step in RecSplit construction is mapping to 128-bit hashes.

Licensing

Sux is licensed exactly like libstdc++ (GPLv3 + GCC Runtime Library Exception), which essentially means you can use it everywhere, exactly like libstdc++.

seba (mailto:[email protected])

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.