Skip to content

module numpy.sorting

Source: stdlib/numpy/sorting.codon


insertionsort(start: Ptr[T], n: int, T: type)


ainsertionsort(v: Ptr[T], tosort: Ptr[int], n: int, T: type)


heapsort(start: Ptr[T], n: int, T: type)


aheapsort(vv: Ptr[T], tosort: Ptr[int], n: int, T: type)


PYA_QS_STACK: Literal[int] = 100


SMALL_QUICKSORT: Literal[int] = 15


SMALL_MERGESORT: Literal[int] = 20


SMALL_STRING: Literal[int] = 16


mergesort(start: Ptr[T], num: int, T: type)


amergesort(v: Ptr[T], tosort: Ptr[int], num: int, T: type)


INSERTION_SORT_THRESHOLD: Literal[int] = 24


NINTHER_THRESHOLD: Literal[int] = 128


PARTIAL_INSERTION_SORT_LIMIT: Literal[int] = 8


cnp_sort_int16(_: cobj, _: int) @C Function is external C function


cnp_sort_uint16(_: cobj, _: int) @C Function is external C function


cnp_sort_int32(_: cobj, _: int) @C Function is external C function


cnp_sort_uint32(_: cobj, _: int) @C Function is external C function


cnp_sort_int64(_: cobj, _: int) @C Function is external C function


cnp_sort_uint64(_: cobj, _: int) @C Function is external C function


cnp_sort_uint128(_: cobj, _: int) @C Function is external C function


cnp_sort_float32(_: cobj, _: int) @C Function is external C function


cnp_sort_float64(_: cobj, _: int) @C Function is external C function


quicksort(start: Ptr[T], n: int, T: type)


aquicksort(start: Ptr[T], tosort: Ptr[int], n: int, T: type)


key_of(x: UT, T: type, UT: type)


nth_byte(key: T, l: int, T: type)


radixsort(start: Ptr[T], num: int, T: type)


aradixsort(start: Ptr[T], tosort: Ptr[int], num: int, T: type)


TIMSORT_STACK_SIZE: Literal[int] = 128


Buffer[T]

Fields

pw: Ptr[T]

size: int

T: type

Magic methods

__init__(self)

Methods

resize(self, new_size: int)

free(self)


timsort(start: Ptr[T], num: int, T: type)


atimsort(start: Ptr[T], tosort: Ptr[int], num: int, T: type)


stablesort(start: Ptr[T], num: int, T: type)


astablesort(start: Ptr[T], tosort: Ptr[int], num: int, T: type)


MAX_PIVOT_STACK: Literal[int] = 50


Sortee[T] @tuple Class is named tuple (cannot write fields)

Fields

v: Ptr[T]

T: type

Magic methods

__call__(self, i: int)

Methods

swap(self, i: int, j: int)


Idx @tuple Class is named tuple (cannot write fields)

Magic methods

__call__(self, i: int)


ArgSortee @tuple Class is named tuple (cannot write fields)

Fields

tosort: Ptr[int]

Magic methods

__call__(self, i: int)

Methods

swap(self, i: int, j: int)


ArgIdx @tuple Class is named tuple (cannot write fields)

Fields

tosort: Ptr[int]

Magic methods

__call__(self, i: int)


partition(a, kth, axis = -1, kind: str = "introselect")


argpartition(a: ndarray, kth, axis = -1, kind: str = "introselect")


lexsort(keys, axis: int = -1)


sort(a, axis = -1, kind: Optional[str] = None)


argsort(a, axis = -1, kind: Optional[str] = None)


sort_complex(a)


ndarray[dtype,ndim] @extend Class is extended to add given methods

Methods

sort(self, axis: int = -1, kind: Optional[str] = None)

argsort(self, axis: int = -1, kind: Optional[str] = None)

partition(self, kth, axis: int = -1, kind: str = "introselect")

argpartition(self, kth, axis: int = -1, kind: str = "introselect")