diff --git a/pyci/include/pyci.h b/pyci/include/pyci.h index 881c2bb..89d20b9 100644 --- a/pyci/include/pyci.h +++ b/pyci/include/pyci.h @@ -117,14 +117,15 @@ inline int Ctz(const unsigned long long t) { } /* Hash function. */ - -typedef std::pair Hash; +typedef std::pair Hash; template Hash spookyhash(T length, const U *data) { - Hash h(0x23a23cf5033c3c81UL, 0xb3816f6a2c68e530UL); - SpookyHash::Hash128(reinterpret_cast(data), length * sizeof(U), &h.first, &h.second); - return h; + Hash h(0x23a23cf5033c3c81ULL, 0xb3816f6a2c68e530ULL); // Use ULL suffix for unsigned long long + uint64_t first = h.first; + uint64_t second = h.second; + SpookyHash::Hash128(reinterpret_cast(data), length * sizeof(U), &first, &second); + return Hash(first, second); } /* Vector template types. */ @@ -135,6 +136,24 @@ using Vector = std::vector; template using AlignedVector = std::vector>; +} +// typedef std::pair Hash; + +// template +// Hash spookyhash(T length, const U *data) { +// Hash h(0x23a23cf5033c3c81UL, 0xb3816f6a2c68e530UL); +// SpookyHash::Hash128(reinterpret_cast(data), length * sizeof(U), &h.first, &h.second); +// return h; +// } + +// /* Vector template types. */ + +// template +// using Vector = std::vector; + +// template +// using AlignedVector = std::vector>; + /* Eigen dense matrix template types. */ #define PYCI_MAT_DYNAMIC Eigen::Dynamic, Eigen::Dynamic