attractivechaos / klib

A standalone and lightweight C library
http://attractivechaos.github.io/klib/
MIT License
4.18k stars 556 forks source link

adjacency set #183

Closed ozeasx closed 2 months ago

ozeasx commented 3 months ago

Would it be possible to implement an adjacency set using khash lib? That is, a hash map of sets.

ozeasx commented 3 months ago

I tried this and it seems to work. Is this correct though?

KHASH_SET_INIT_INT(set)
KHASH_INIT(map, int, khash_t(set)*, 1, kh_int_hash_func, kh_int_hash_equal)
ozeasx commented 2 months ago

I'm going to close this issue since the proposed solution works.