aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/utils/sort.h
diff options
context:
space:
mode:
authorvvvv <vvvv@yandex-team.com>2024-11-01 15:41:40 +0300
committervvvv <vvvv@yandex-team.com>2024-11-01 15:55:52 +0300
commit3325f745e67f7f442790822b5c9c5e9996708be7 (patch)
treef7318d68bbe8990092715436444b05297ce35777 /yql/essentials/utils/sort.h
parent6dce3f1c71786f2694b73b1a5155efc58f4557dd (diff)
downloadydb-3325f745e67f7f442790822b5c9c5e9996708be7.tar.gz
Moved yql/utils YQL-19206
Также была выделена жирная зависимость из yql/utils в yql/utils/network, в результате library/cpp/getopt была добавлена явно в те проекты, которые ее ранее наследовали, а не указывали явно commit_hash:36aa4c41f807b4cbbf70a3ed7ac0a1a5079bb75d
Diffstat (limited to 'yql/essentials/utils/sort.h')
-rw-r--r--yql/essentials/utils/sort.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/yql/essentials/utils/sort.h b/yql/essentials/utils/sort.h
new file mode 100644
index 0000000000..4adb7c9225
--- /dev/null
+++ b/yql/essentials/utils/sort.h
@@ -0,0 +1,27 @@
+#pragma once
+
+#include <contrib/libs/miniselect/include/miniselect/floyd_rivest_select.h>
+
+namespace NYql {
+
+template <class RandomIt>
+void FastNthElement(RandomIt first, RandomIt middle, RandomIt last) {
+ ::miniselect::floyd_rivest_select(first, middle, last);
+}
+
+template <class RandomIt, class Compare>
+void FastNthElement(RandomIt first, RandomIt middle, RandomIt last, Compare compare) {
+ ::miniselect::floyd_rivest_select(first, middle, last, compare);
+}
+
+template <class RandomIt>
+void FastPartialSort(RandomIt first, RandomIt middle, RandomIt last) {
+ ::miniselect::floyd_rivest_partial_sort(first, middle, last);
+}
+
+template <class RandomIt, class Compare>
+void FastPartialSort(RandomIt first, RandomIt middle, RandomIt last, Compare compare) {
+ ::miniselect::floyd_rivest_partial_sort(first, middle, last, compare);
+}
+
+}