Skip to content

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

@fingolfin

Description

@fingolfin

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions