29 memcpy(&val, f,
sizeof(
double));
31 auto adjusted = val ^ mask;
32 return (adjusted >> (64 - 8 - shift)) & 0xFF;
44 memset(buckets, 0, 256 *
sizeof(
uint64_t));
54 buckets[
i + 256] = prev;
68 for (
int i = 0;
i < 256;
i++) {
69 if (buckets[
i] < 256) {
70 std::sort(out + tot, out + tot + buckets[
i]);
72 memcpy(in + tot, out + tot, buckets[i] *
sizeof(
double));
76 buckets[
i], buckets + 256, shift + 8, !inout, out + tot, in + tot);
86 std::sort(in, in + n);
void double_radix_sort(uint64_t n, uint64_t *buckets, double *in, double *tmp)
—— Concurrent Priority Queue Implementation ——
static uint8_t getRadixBucket(double *f, uint8_t shift)
static void double_radix_sort_rec(uint64_t n, uint64_t *buckets, uint8_t shift, bool inout, double *in, double *out)