void rkvsorti(size_t n, rkv_t *base) { #define rkey_lt(a, b) ((a)->key < (b)->key) GK_MKQSORT(rkv_t, base, n, rkey_lt); #undef rkey_lt }
void simsortd(size_t n, sim_t *base) { #define sim_gt(a, b) ((a)->sim.f > (b)->sim.f) GK_MKQSORT(sim_t, base, n, sim_gt); #undef sim_gt }
/* Sorts based both on key and val */ void ikvsortii(size_t n, ikv_t *base) { #define ikeyval_lt(a, b) ((a)->key < (b)->key || ((a)->key == (b)->key && (a)->val < (b)->val)) GK_MKQSORT(ikv_t, base, n, ikeyval_lt); #undef ikeyval_lt }
void ikvsortd(size_t n, ikv_t *base) { #define ikey_gt(a, b) ((a)->key > (b)->key) GK_MKQSORT(ikv_t, base, n, ikey_gt); #undef ikey_gt }
void rsortd(size_t n, real_t *base) { #define r_gt(a, b) ((*a) > (*b)) GK_MKQSORT(real_t, base, n, r_gt); #undef r_gt }
void ikvsorti(size_t n, ikv_t *base) { #define ikey_lt(a, b) ((a)->key < (b)->key) GK_MKQSORT(ikv_t, base, n, ikey_lt); #undef ikey_lt }
void rsorti(size_t n, real_t *base) { #define r_lt(a, b) ((*a) < (*b)) GK_MKQSORT(real_t, base, n, r_lt); #undef r_lt }
void isortd(size_t n, idx_t *base) { #define i_gt(a, b) ((*a) > (*b)) GK_MKQSORT(idx_t, base, n, i_gt); #undef i_gt }
void isorti(size_t n, idx_t *base) { #define i_lt(a, b) ((*a) < (*b)) GK_MKQSORT(idx_t, base, n, i_lt); #undef i_lt }
void uvwsorti(size_t n, uvw_t *base) { #define uvwkey_lt(a, b) ((a)->u < (b)->u || ((a)->u == (b)->u && (a)->v < (b)->v)) GK_MKQSORT(uvw_t, base, n, uvwkey_lt); #undef uvwkey_lt }
void rkvsortd(size_t n, rkv_t *base) { #define rkey_gt(a, b) ((a)->key > (b)->key) GK_MKQSORT(rkv_t, base, n, rkey_gt); #undef rkey_gt }