template <size_t Width>
class probe_seq
Defined at line 311 of file ../../third_party/abseil-cpp/absl/container/internal/raw_hash_set.h
The state for a probe sequence.
Currently, the sequence is a triangular progression of the form
p(i) := Width * (i^2 + i)/2 + hash (mod mask + 1)
The use of `Width` ensures that each probe step does not overlap groups;
the sequence effectively outputs the addresses of *groups* (although not
necessarily aligned to any boundary). The `Group` machinery allows us
to check an entire group with minimal branching.
Wrapping around at `mask + 1` is important, but not for the obvious reason.
As described above, the first few entries of the control byte array
are mirrored at the end of the array, which `Group` will find and use
for selecting candidates. However, when those candidates' slots are
actually inspected, there are no corresponding slots for the cloned bytes,
so we need to make sure we've treated those offsets as "wrapping around".
It turns out that this probe sequence visits every group exactly once if the
number of groups is a power of two, since (i^2+i)/2 is a bijection in
Z/(2^m). See https://en.wikipedia.org/wiki/Quadratic_probing
Public Methods
void probe_seq<Width> (size_t hash, size_t mask)
Creates a new probe sequence using `hash` as the initial value of the
sequence and `mask` (usually the capacity of the table) as the mask to
apply to each value in the progression.
Defined at line 316 of file ../../third_party/abseil-cpp/absl/container/internal/raw_hash_set.h
size_t offset ()
The offset within the table, i.e., the value `p(i)` above.
Defined at line 323 of file ../../third_party/abseil-cpp/absl/container/internal/raw_hash_set.h
size_t offset (size_t i)
Defined at line 324 of file ../../third_party/abseil-cpp/absl/container/internal/raw_hash_set.h
void next ()
Defined at line 326 of file ../../third_party/abseil-cpp/absl/container/internal/raw_hash_set.h
size_t index ()
0-based probe index, a multiple of `Width`.
Defined at line 332 of file ../../third_party/abseil-cpp/absl/container/internal/raw_hash_set.h