rthier randomized only above threshold
This commit is contained in:
parent
9b9997cbdb
commit
12431f229e
5
ypsu.cpp
5
ypsu.cpp
@ -231,8 +231,11 @@ static inline void do_thier3(uint32_t *a, int n) noexcept {
|
|||||||
/** rthier */
|
/** rthier */
|
||||||
static inline void do_rthier(uint32_t *a, int n) noexcept {
|
static inline void do_rthier(uint32_t *a, int n) noexcept {
|
||||||
assert(n * uint32_t(sizeof(a[0])) <= INT_MAX);
|
assert(n * uint32_t(sizeof(a[0])) <= INT_MAX);
|
||||||
|
if(n > 140000000) {
|
||||||
|
/* Helps a bit against our worst cases in big numbers */
|
||||||
uint32_t junk;
|
uint32_t junk;
|
||||||
randominus(a, n, junk);
|
randominus(a, n, junk);
|
||||||
|
}
|
||||||
std::vector<uint32_t> tmp(n);
|
std::vector<uint32_t> tmp(n);
|
||||||
thiersort3(a, &(tmp[0]), n);
|
thiersort3(a, &(tmp[0]), n);
|
||||||
}
|
}
|
||||||
@ -945,6 +948,7 @@ int main(int argc, char **argv) {
|
|||||||
});
|
});
|
||||||
assert(w == expected);
|
assert(w == expected);
|
||||||
|
|
||||||
|
/*
|
||||||
w = v;
|
w = v;
|
||||||
measure(inputtype, "rmagyar", [&] {
|
measure(inputtype, "rmagyar", [&] {
|
||||||
uint32_t junk;
|
uint32_t junk;
|
||||||
@ -952,6 +956,7 @@ int main(int argc, char **argv) {
|
|||||||
MagyarSort::sort<uint32_t>(&w[0], w.size());
|
MagyarSort::sort<uint32_t>(&w[0], w.size());
|
||||||
});
|
});
|
||||||
assert(w == expected);
|
assert(w == expected);
|
||||||
|
*/
|
||||||
|
|
||||||
w = v;
|
w = v;
|
||||||
measure(inputtype, "gptbuck", [&] { gpt_bucket_sort(&w[0], w.size()); });
|
measure(inputtype, "gptbuck", [&] { gpt_bucket_sort(&w[0], w.size()); });
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user