27 constexpr RadixHeap() : bucket_mins() {
28 std::ranges::fill(bucket_mins, std::numeric_limits<uint64_t>::max());
31 void push(uint64_t val);
34 uint64_t peek()
const;
45 static size_t get_bucket_index(
const uint64_t min_val,
const uint64_t val) {
46 const uint64_t xor_op = val ^ min_val;
47 const int leading_zeroes = std::countl_zero<uint64_t>(xor_op);
48 return NUM_BITS - leading_zeroes;
51 static constexpr size_t NUM_BITS =
sizeof(uint64_t) * 8U;
52 static constexpr size_t NUM_BUCKETS = NUM_BITS + 1U;
54 std::array<std::vector<uint64_t>, NUM_BUCKETS> buckets{};
55 std::array<uint64_t, NUM_BUCKETS> bucket_mins;