c++ - Hash function to map unique array of int to an index of range 0..n -
c++ - Hash function to map unique array of int to an index of range 0..n -
i need map array of sorted integers, length varying 1 4 @ max, index of global array. [13,24,32] becoming number in range 0..n, , no other array mapping same number. quantity of arrays few millions, , mapping has "unique" (or @ to the lowest degree few collisions smaller arrays), because these arrays represent itemsets , utilize k-1 smaller itemset build 1 of size k.
my current implementation uses efficient hash function produces double between 0..1 array, , store itemsets in stl map, double key. got article:
n. d. atreas, c. karanikas “a faster pattern matching algorithm based on prime numbers , hashing approximation “, 2007
i'm going implement parallel version of in cuda, can't utilize stl map. create myself self-balancing binary search tree map in gpu global memory, slow. in order cut down global memory access minimum, need map itemset huge array in global memory.
i've tried cast double long integer , hash 64 bit hash function, produces collision, expected.
so, inquire if there's "unique" hash function doubles between 0..1, or array of integers size 1..4, gives unique index table of size n.
if create assumption arrays:
each item of arrays (such 13) 32-bit integers. then inquire impossible.
you have @ to the lowest degree 2^(32*4) possible values, or 128 bits. , trying pack array of much smaller size (20 bits 1 1000000 entries). cannot without collisions (or there beingness understanding amongst elements, such each element choosing "next available index", that's not hash).
c++ c arrays hash cuda
Comments
Post a Comment