summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bx/include/bx/sort.h
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/bx/include/bx/sort.h')
-rw-r--r--3rdparty/bx/include/bx/sort.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/3rdparty/bx/include/bx/sort.h b/3rdparty/bx/include/bx/sort.h
new file mode 100644
index 00000000000..2f1511bab5a
--- /dev/null
+++ b/3rdparty/bx/include/bx/sort.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2010-2017 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ */
+
+#ifndef BX_SORT_H_HEADER_GUARD
+#define BX_SORT_H_HEADER_GUARD
+
+#include "bx.h"
+
+namespace bx
+{
+ ///
+ typedef int32_t (*ComparisonFn)(const void* _lhs, const void* _rhs);
+
+ ///
+ void quickSort(
+ void* _data
+ , uint32_t _num
+ , uint32_t _stride
+ , const ComparisonFn _fn
+ );
+
+ ///
+ void radixSort(
+ uint32_t* _keys
+ , uint32_t* _tempKeys
+ , uint32_t _size
+ );
+
+ ///
+ template <typename Ty>
+ void radixSort(
+ uint32_t* _keys
+ , uint32_t* _tempKeys
+ , Ty* _values
+ , Ty* _tempValues
+ , uint32_t _size
+ );
+
+ ///
+ void radixSort(
+ uint64_t* _keys
+ , uint64_t* _tempKeys
+ , uint32_t _size
+ );
+
+ ///
+ template <typename Ty>
+ void radixSort(
+ uint64_t* _keys
+ , uint64_t* _tempKeys
+ , Ty* _values
+ , Ty* _tempValues
+ , uint32_t _size
+ );
+
+} // namespace bx
+
+#include "inline/sort.inl"
+
+#endif // BX_SORT_H_HEADER_GUARD