Skip to content

implement a minimal perfect hashing policy #56

Description

@jll63

Implement a new type_hash policy, minimal_perfect_hash, that is modeled after the existing fast_perfect_hash policy, except that it finds a perfect minimal hash function using the PtHash algorithm. The primary hash function is in the form H(x) = (M * x) >> N, where x is the value to hash (a type_id), and M and N are the integer parameters of the hash function. Like with fast_perfect_hash, if the runtime_checks policy is present in the registry, create a control table during initialization, and use it during hashing to check that the input value x is in the universe passed to initialize. Also create a test suite.

Activity

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

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions