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

Add optional weights to rrbtree and flex_vector #158

Open
jeffplaisance opened this issue Aug 30, 2020 · 1 comment
Open

Add optional weights to rrbtree and flex_vector #158

jeffplaisance opened this issue Aug 30, 2020 · 1 comment

Comments

@jeffplaisance
Copy link

I have a use case where I need fast prefix sum over the elements of a flex_vector at an index and the ability to find the smallest index in a flex_vector where the prefix sum is greater than or equal to a specified value. This should be doable by decorating the internal nodes with a sum of weights for each of their children where the sum of weights for a leaf node is the sum of the values (possibly after applying some function to the value like measurements in 2-3 finger trees, also possibly allowing for operators other than addition such as min to allow for ordered set/map semantics). I had started writing my own library for a similar datastructure to do this when I came across this project and it seems like you've done pretty much everything I wanted to do except for weights.

If this is something you are interested in doing let me know. If it is not something you are interested in doing but is something you'd be possibly interested in accepting a pull request for, also let me know. Thanks.

@arximboldi
Copy link
Owner

Hi @jeffplaisance!

Thanks for the suggestion. I do think that this is indeed an interesting feature.

If this is for a commercial project, maybe we could agree on a development contract for the feature, send me an email to discuss the details. In any case I'd be interested in a pull request in this direction. You can send me an email too to discuss the API details.

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

No branches or pull requests

2 participants