GithubHelp home page GithubHelp logo

succinct's Introduction

succinct

Hackage Build Status

This is a playground for exploring succinct data structures in Haskell

Contact Information

Contributions and bug reports are welcome!

Please feel free to contact me through github or on the #haskell IRC channel on irc.freenode.net.

-Edward Kmett

succinct's People

Contributors

amr1 avatar aristidb avatar bgamari avatar ekmett avatar klao avatar meiersi avatar nanotech avatar nitromaster101 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

succinct's Issues

Implement forwardSearch and backwardSearch

The RangeMin tree is based on the ideas from Fully-Functional Succinct Trees by Sadakane and Navarro.

However, I only store the minima rather than both minima and maxima, based on an observation in Fast Compressed Tries through Path Decompositions by Grossi and Ottaviano.

I also store the encoding of the minima as a delta in order to get a proper monoid.

Since the structure I have is trivially isomorphic to Grossi and Ottaviano's, it should be capable of supporting fwd-search and bwd-search which is necessary for fast balanced-parentheses trees.

How to index a tree that stores elements at each node?

Let's assume that I have something like Tree from Data.Tree in containers and I want to efficiently navigate this tree using a zipper into a compressed index to retrieve elements from the tree. My rough understanding is that the way I would do this is:

  1. Define my own function from Tree to Succinct.Tree.LOUDS.Rose that just extracts the tree's skeleton
  2. Compute a Rank9 index from my Rose-encoded skeleton using Succinct.Tree.LOUDS.fromRose
  3. Store the index alongside an array containing the tree elements in some order. I'm guessing they would be stored in level order (for LOUDS), but I'm not totally sure.
  4. When it's time to retrieve an element, wrap the Rank9 index in a Zipper using root so I can navigate the skeleton of the tree without materializing it using all the zipper operations
  5. After I navigate to some node, I need to retrieve the index into my array of elements. This is the part I don't know how to do since I'm not sure how I retrieve that index from the Zipper. I read the documentation for Zipper but it's still pretty unclear to me if one of the two Int fields is the index or not.

So basically I need help with steps 3 and 5: what order do I store the array of elements and how do I retrieve the index into the array from the Zipper?

Bitvectors polymorphic in underlying Vector type

Currently the bitvectors in succinct are represented by Data.Vector.Unboxed Vectors. Allowing bitvectors of any Vector type would, among other things, enable easy disk backing of succinct structures (with an mmap'd Storable vector).

I have a first cut at this generalization in my generalize-vector branch. This isn't a pull request as I'm not entirely pleased with how intrusive this change is as it sits. I've tried to preserve the existing monomorphic interfaces for ease of use by building them on top of polymorphic primed variants (e.g. Rose).

Reintroduce inlines

Investigate the issue that prompted 7b44e6d, maybe it was caused by a trivial bug:

When I reintroduced the inlines on the rank1 and rank0 methods in the Ranked class, it triggered the 'simplifier ticks exhausted'. But, I noticed that the definitions were bogus:

rank1 t i = i - rank1 t i

Instead of rank0 and rank1 being defined in terms of each other. When I fixed this, the simplifier wasn't exhausted anymore. :)

Oh, and if this really was the cause, then this should be fixed in GHC!

Buggy Zippers

Somewhere along the way I changed an implementation detail and appear to have broken the tree zippers.

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.