Function search

Source
pub(crate) fn search<const TEMP_N: usize, const TEMP_CAP: usize, A, F, C, K, KS>(
    array: &A,
    scratchpad: &mut BucketArrayMemory<TEMP_N, TEMP_CAP, C>,
    num_bits: usize,
    predicate: F,
)
where A: Shape<K> + KeyLookup<KS, K>, F: FnMut(K, CollisionLocation), C: Count, K: Key, KS: KeyStorage<K>,
Expand description

Look for partial sum collisions between items in one bucket array.

The items in each bucket are not sorted. This uses an additional small hash table, with the supplied backing memory, to collect matches.

The temporary memory can have an arbitrary shape. Capacity of the buffer will affect how may potential collisions we have to discard, and bucket count will affect how much of the key we are operating on. Its value type must match the Count type of the input table, since it will store item-in-bucket indices.

For each collision, calls the supplied predicate with the remaining portion of the hash sum and a CollisionLocation describing the two items.