Compute band hash for band `b` from a MinHash signature. * Uses r=2 consecutive values starting at position b*r. */
| 342 | /* Compute band hash for band `b` from a MinHash signature. |
| 343 | * Uses r=2 consecutive values starting at position b*r. */ |
| 344 | static uint32_t band_hash(const cbm_minhash_t *fp, int band) { |
| 345 | int base = band * CBM_LSH_ROWS; |
| 346 | /* Combine r=2 values into a single hash */ |
| 347 | uint32_t combined[CBM_LSH_ROWS]; |
| 348 | for (int r = 0; r < CBM_LSH_ROWS; r++) { |
| 349 | combined[r] = fp->values[base + r]; |
| 350 | } |
| 351 | uint64_t h = XXH3_64bits(combined, sizeof(combined)); |
| 352 | return (uint32_t)(h & LSH_BUCKET_MASK); |
| 353 | } |
| 354 | |
| 355 | static void bucket_push(lsh_bucket_t *bucket, int entry_index) { |
| 356 | if (bucket->count >= bucket->cap) { |
no outgoing calls
no test coverage detected