|
numpy
2.0.0
|
#include "npy_sort.h"#include "npysort_common.h"#include "numpy/npy_math.h"#include "npy_partition.h"#include <stdlib.h>Defines | |
| #define | NPY_NO_DEPRECATED_API NPY_API_VERSION |
| #define | NOT_USED NPY_UNUSED(unused) |
| #define | IDX(x) (x) |
| #define | SORTEE(x) v[x] |
| #define | SWAP @TYPE@_SWAP |
| #define | MEDIAN3_SWAP(v, tosort, low, mid, high) median3_swap_@suff@(v, low, mid, high) |
| #define | MEDIAN5(v, tosort, subleft) median5_@suff@(v + subleft) |
| #define | UNGUARDED_PARTITION(v, tosort, pivot, ll, hh) unguarded_partition_@suff@(v, pivot, ll, hh) |
| #define | INTROSELECT(v, tosort, num, kth, pivots, npiv) introselect_@suff@(v, nmed, nmed / 2, pivots, npiv, NULL) |
| #define | DUMBSELECT(v, tosort, left, num, kth) dumb_select_@suff@(v + left, num, kth) |
Functions | |
| static NPY_INLINE void | store_pivot (npy_intp pivot, npy_intp kth, npy_intp *pivots, npy_intp *npiv) |
| static npy_intp amedian_of_median5_ | suff (@type @*v, npy_intp *tosort, const npy_intp num, npy_intp *pivots, npy_intp *npiv) |
| static npy_intp median_of_median5_ | suff (@type @*v, const npy_intp num, npy_intp *pivots, npy_intp *npiv) |
| static NPY_INLINE void name median3_swap_ | suff (@type @*v, npy_intp low, npy_intp mid, npy_intp high) |
| static npy_intp name median5_ | suff (@type @*v) |
| static NPY_INLINE void name unguarded_partition_ | suff (@type @*v, const @type @pivot, npy_intp *ll, npy_intp *hh) |
| static int name dumb_select_ | suff (@type @*v, npy_intp num, npy_intp kth) |
| int name introselect_ | suff (@type @*v, npy_intp num, npy_intp kth, npy_intp *pivots, npy_intp *npiv, void *NOT_USED) |
| #define DUMBSELECT | ( | v, | |
| tosort, | |||
| left, | |||
| num, | |||
| kth | |||
| ) | dumb_select_@suff@(v + left, num, kth) |
Referenced by suff().
| #define INTROSELECT | ( | v, | |
| tosort, | |||
| num, | |||
| kth, | |||
| pivots, | |||
| npiv | |||
| ) | introselect_@suff@(v, nmed, nmed / 2, pivots, npiv, NULL) |
| #define MEDIAN3_SWAP | ( | v, | |
| tosort, | |||
| low, | |||
| mid, | |||
| high | |||
| ) | median3_swap_@suff@(v, low, mid, high) |
| #define NOT_USED NPY_UNUSED(unused) |
| #define NPY_NO_DEPRECATED_API NPY_API_VERSION |
| #define UNGUARDED_PARTITION | ( | v, | |
| tosort, | |||
| pivot, | |||
| ll, | |||
| hh | |||
| ) | unguarded_partition_@suff@(v, pivot, ll, hh) |
| static NPY_INLINE void store_pivot | ( | npy_intp | pivot, |
| npy_intp | kth, | ||
| npy_intp * | pivots, | ||
| npy_intp * | npiv | ||
| ) | [static] |
References NPY_MAX_PIVOT_STACK.
Referenced by suff().
| static npy_intp amedian_of_median5_ suff | ( | @type @* | v, |
| npy_intp * | tosort, | ||
| const npy_intp | num, | ||
| npy_intp * | pivots, | ||
| npy_intp * | npiv | ||
| ) | [static] |
| static npy_intp name median_of_median5_ suff | ( | @type @* | v, |
| const npy_intp | num, | ||
| npy_intp * | pivots, | ||
| npy_intp * | npiv | ||
| ) | [static] |
References IDX.
| static NPY_INLINE void name unguarded_partition_ suff | ( | @type @* | v, |
| const @type @ | pivot, | ||
| npy_intp * | ll, | ||
| npy_intp * | hh | ||
| ) | [static] |
<blockquote> ll ... hh</blockquote>
References DUMBSELECT, IDX, and store_pivot().
| int name introselect_ suff | ( | @type @* | v, |
| npy_intp | num, | ||
| npy_intp | kth, | ||
| npy_intp * | pivots, | ||
| npy_intp * | npiv, | ||
| void * | NOT_USED | ||
| ) |
<blockquote> 0 1 2 3 4 8 7 5 6 -> pop requested kth -> stack [4, 2]</blockquote>