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

Replace ChooseHashFunction with something that does not involve the hashtable size #22

Open
fingolfin opened this issue Jan 11, 2016 · 0 comments

Comments

@fingolfin
Copy link
Member

Currently, methods for ChooseHashFunction are expected to return a value in a certain interval (perhaps the size of the hash table) they usually achieve that by computing an integer hash value, and then taking that mod the size of the interval.

Instead, I think hash functions should not know anything about the size of the hash table. They should simply be required to return a value which is a GAP small integer, i.e. a value between 0 and $2^{28}-1$ resp. $2^{60}-1$ (32 vs. 64 bit).

I guess for compatibility reasons, ChooseHashFunction will have to stay as it is, but perhaps we can add a new operation which is similar, but takes only one parameter (omitting the hash len), and which returns hash functions which work as I just described.

This will ultimately allow us to implement hash tables which are more efficient than the current ones, and it also is important if one expects hash tables to grow (which they typically do).

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

1 participant