Skip to main content

function

sort

sort(inout buff: LegacyPointer[Int, 0], len: Int)

Sort the vector inplace.

The function doesn't return anything, the vector is updated inplace.

Args:

  • buff (LegacyPointer[Int, 0]): Input buffer.
  • len (Int): The length of the buffer.

sort[type: DType](inout buff: LegacyPointer[SIMD[type, 1], 0], len: Int)

Sort the vector inplace.

The function doesn't return anything, the vector is updated inplace.

Parameters:

  • type (DType): DType of the underlying data.

Args:

  • buff (LegacyPointer[SIMD[type, 1], 0]): Input buffer.
  • len (Int): The length of the buffer.

sort(inout v: List[Int])

Sort the vector inplace.

The function doesn't return anything, the vector is updated inplace.

Args:

  • v (List[Int]): Input integer vector to sort.

sort[type: DType](inout v: List[SIMD[type, 1]])

Sort the vector inplace.

The function doesn't return anything, the vector is updated inplace.

Parameters:

  • type (DType): DType of the underlying data.

Args:

  • v (List[SIMD[type, 1]]): Input vector to sort.

sort[type: CollectionElement, cmp_fn: fn($0, $0, /) capturing -> Bool](inout v: List[type])

Sort the vector inplace.

The function doesn't return anything, the vector is updated inplace.

Parameters:

  • type (CollectionElement): DType of the underlying data.
  • cmp_fn (fn($0, $0, /) capturing -> Bool): The comparison function.

Args:

  • v (List[type]): Input vector to sort.