Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packed(Sparse?)IntSet Implementation #532

Closed
louisponet opened this issue Sep 26, 2019 · 1 comment
Closed

Packed(Sparse?)IntSet Implementation #532

louisponet opened this issue Sep 26, 2019 · 1 comment

Comments

@louisponet
Copy link
Contributor

I've recently played around with implementing something like:
Sparse Set (geeksforgeeks),
but without the maximum value limitation and with a paging mechanism to make the reverse actually sparse.The idea is to have fast insertion, in operations but also very fast iteration over which indices are actually occupied.

I was wondering if this could find a place here, I can clean up the code and make decent tests for it. There are also the mathematical set functions that I didn't really need and thus didn't implement yet, but I wouldn't mind doing so if there's interest.

I'm using this to handle the indexing for an entity component system, and it seems to be pretty fast and reliable. There is also a fast zip-like iterator that returns the positions in the packed array that correspond to the same index, this can be then used with different component vectors for example. The current implementation is here:
PackedIntSet

@oxinabox
Copy link
Member

Yes, PR would be welcomed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants