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

support for long arrays #5

Open
karasikov opened this issue Dec 22, 2019 · 3 comments
Open

support for long arrays #5

karasikov opened this issue Dec 22, 2019 · 3 comments

Comments

@karasikov
Copy link

Dear Marcus,

Is it possible to change the length types to uint64_t so that the algorithms work for very long arrays as well (~2^35 of 8-byte words)?

I found another library https://github.com/kimwalisch/libpopcnt, where they use uint64_t, but unfortunately, it doesn't have your nice functions for computing intersection and union.

@mklarqvist
Copy link
Owner

Although the function interface is f(const uint8_t* data, size_t size) you are free to pass any primitive type as input by casting. For example, for 64-bit values you can call it like this:
f((const uint64_t*)data, size*sizeof(uint64_t)). Internally, all computations are performed on 64-bit words.

@mklarqvist
Copy link
Owner

Importantly, this is true for all subroutines in this library with the exception of the pospopcnt family of operations which are limited to 16-bit input words.

@karasikov
Copy link
Author

karasikov commented Dec 23, 2019

Yes, I wanted to ask about that... https://github.com/mklarqvist/libalgebra/blob/master/libalgebra.h#L567

But there are int types in other functions too, for instance in https://github.com/mklarqvist/libalgebra/blob/master/libalgebra.h#L1439,
where int i is compared to the size_t n_ints, potentially very large.

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