<!--
{
  "documentType" : "article",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/reversing-and-sorting-functions",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Reversing and sorting functions"
}
-->

# Reversing and sorting functions

Perform in-place reverse and sort operations on a vector.

## Topics

### Vector reversing functions

[`reverse(_:)`](/documentation/Accelerate/vDSP/reverse(_:)-38ptd)

Reverses a vector of single-precision values in-place.

[`reverse(_:)`](/documentation/Accelerate/vDSP/reverse(_:)-3aq38)

Reverses a vector of double-precision values in-place.

[`vDSP_vrvrs`](/documentation/Accelerate/vDSP_vrvrs)

Performs an in-place reversal of a single-precision vector.

[`vDSP_vrvrsD`](/documentation/Accelerate/vDSP_vrvrsD)

Performs an in-place reversal of a double-precision vector.

### Vector sorting functions

The functions in this group sort the values in a vector.

[`sort(_:sortOrder:)`](/documentation/Accelerate/vDSP/sort(_:sortOrder:)-wx0w)

Sorts a vector of single-precision values in-place.

[`sort(_:sortOrder:)`](/documentation/Accelerate/vDSP/sort(_:sortOrder:)-418g0)

Sorts a vector of double-precision values in-place.

[`SortOrder`](/documentation/Accelerate/vDSP/SortOrder)

Constants that specify the sorting order.

[`vDSP_vsort`](/documentation/Accelerate/vDSP_vsort)

Performs an in-place sort of a single-precision vector.

[`vDSP_vsortD`](/documentation/Accelerate/vDSP_vsortD)

Performs an in-place sort of a double-precision vector.

[`vDSP_vsorti`](/documentation/Accelerate/vDSP_vsorti)

Performs an in-place sort of the indices into a single-precision vector.

[`vDSP_vsortiD`](/documentation/Accelerate/vDSP_vsortiD)

Performs an in-place sort of the indices into a double-precision vector.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)