<!--
{
  "documentType" : "article",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/vector-extrema-calculation",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Vector extrema calculation"
}
-->

# Vector extrema calculation

Calculate the minimum and maximum values in a vector.

## Topics

### Calculating the minimum value of a vector

[`static func minimum<U>(U) -> Float`](/documentation/Accelerate/vDSP/minimum(_:)-9b5zc)

Returns the single-precision minimum value of a vector.

[`static func minimum<U>(U) -> Double`](/documentation/Accelerate/vDSP/minimum(_:)-4w8y3)

Returns the double-precision minimum value of a vector.

[`extern void vDSP_minv(const float *__A, vDSP_Stride __IA, float *__C, vDSP_Length __N);`](/documentation/Accelerate/vDSP_minv)

Calculates the single-precision minimum value of a vector.

[`extern void vDSP_minvD(const double *__A, vDSP_Stride __IA, double *__C, vDSP_Length __N);`](/documentation/Accelerate/vDSP_minvD)

Calculates the double-precision minimum value of a vector.

[`extern void vDSP_minmgv(const float *__A, vDSP_Stride __IA, float *__C, vDSP_Length __N);`](/documentation/Accelerate/vDSP_minmgv)

Calculates the single-precision minimum magnitude of a vector.

[`extern void vDSP_minmgvD(const double *__A, vDSP_Stride __IA, double *__C, vDSP_Length __N);`](/documentation/Accelerate/vDSP_minmgvD)

Calculates the double-precision minimum magnitude of a vector.

### Calculating the index of the minimum value of a vector

[`static func indexOfMinimum<U>(U) -> (UInt, Float)`](/documentation/Accelerate/vDSP/indexOfMinimum(_:)-989q3)

Returns the maximum value and corresponding index in a single-precision vector.

[`static func indexOfMinimum<U>(U) -> (UInt, Double)`](/documentation/Accelerate/vDSP/indexOfMinimum(_:)-56tf7)

Returns the maximum value and corresponding index in a double-precision vector.

[`extern void vDSP_minvi(const float *__A, vDSP_Stride __IA, float *__C, vDSP_Length *__I, vDSP_Length __N);`](/documentation/Accelerate/vDSP_minvi)

Calculates the minimum value and corresponding index in a single-precision vector.

[`extern void vDSP_minviD(const double *__A, vDSP_Stride __IA, double *__C, vDSP_Length *__I, vDSP_Length __N);`](/documentation/Accelerate/vDSP_minviD)

Calculates the minimum value and corresponding index in a double-precision vector.

[`extern void vDSP_minmgvi(const float *__A, vDSP_Stride __IA, float *__C, vDSP_Length *__I, vDSP_Length __N);`](/documentation/Accelerate/vDSP_minmgvi)

Calculates the minimum magnitude and corresponding index in a single-precision vector.

[`extern void vDSP_minmgviD(const double *__A, vDSP_Stride __IA, double *__C, vDSP_Length *__I, vDSP_Length __N);`](/documentation/Accelerate/vDSP_minmgviD)

Calculates the minimum magnitude and corresponding index in a double-precision vector.

### Calculating the maximum value of a vector

[`static func maximum<U>(U) -> Float`](/documentation/Accelerate/vDSP/maximum(_:)-220y6)

Returns the single-precision maximum value of a vector.

[`static func maximum<U>(U) -> Double`](/documentation/Accelerate/vDSP/maximum(_:)-6lwgw)

Returns the double-precision maximum value of a vector.

[`extern void vDSP_maxv(const float *__A, vDSP_Stride __IA, float *__C, vDSP_Length __N);`](/documentation/Accelerate/vDSP_maxv)

Calculates the single-precision maximum value of a vector.

[`extern void vDSP_maxvD(const double *__A, vDSP_Stride __I, double *__C, vDSP_Length __N);`](/documentation/Accelerate/vDSP_maxvD)

Calculates the double-precision maximum value of a vector.

[`static func maximumMagnitude<U>(U) -> Float`](/documentation/Accelerate/vDSP/maximumMagnitude(_:)-19jre)

Returns the single-precision maximum magnitude of a vector.

[`static func maximumMagnitude<U>(U) -> Double`](/documentation/Accelerate/vDSP/maximumMagnitude(_:)-557r4)

Returns the double-precision maximum magnitude of a vector.

[`extern void vDSP_maxmgv(const float *__A, vDSP_Stride __IA, float *__C, vDSP_Length __N);`](/documentation/Accelerate/vDSP_maxmgv)

Calculates the single-precision maximum magnitude of a vector.

[`extern void vDSP_maxmgvD(const double *__A, vDSP_Stride __IA, double *__C, vDSP_Length __N);`](/documentation/Accelerate/vDSP_maxmgvD)

Calculates the double-precision maximum magnitude of a vector.

### Calculating the index of the maximum value of a vector

[`static func indexOfMaximum<U>(U) -> (UInt, Float)`](/documentation/Accelerate/vDSP/indexOfMaximum(_:)-5qdtm)

Returns the maximum value and corresponding index in a single-precision vector.

[`static func indexOfMaximum<U>(U) -> (UInt, Double)`](/documentation/Accelerate/vDSP/indexOfMaximum(_:)-8h0hm)

Returns the maximum value and corresponding index in a double-precision vector.

[`extern void vDSP_maxvi(const float *__A, vDSP_Stride __IA, float *__C, vDSP_Length *__I, vDSP_Length __N);`](/documentation/Accelerate/vDSP_maxvi)

Calculates the maximum value and corresponding index in a single-precision vector.

[`extern void vDSP_maxviD(const double *__A, vDSP_Stride __IA, double *__C, vDSP_Length *__I, vDSP_Length __N);`](/documentation/Accelerate/vDSP_maxviD)

Calculates the maximum value and corresponding index in a double-precision vector.

[`static func indexOfMaximumMagnitude<U>(U) -> (UInt, Float)`](/documentation/Accelerate/vDSP/indexOfMaximumMagnitude(_:)-f14b)

Returns the maximum magnitude and corresponding index in a single-precision vector.

[`static func indexOfMaximumMagnitude<U>(U) -> (UInt, Double)`](/documentation/Accelerate/vDSP/indexOfMaximumMagnitude(_:)-6847f)

Returns the maximum magnitude and corresponding index in a double-precision vector.

[`extern void vDSP_maxmgvi(const float *__A, vDSP_Stride __IA, float *__C, vDSP_Length *__I, vDSP_Length __N);`](/documentation/Accelerate/vDSP_maxmgvi)

Calculates the maximum magnitude and corresponding index in a single-precision vector.

[`extern void vDSP_maxmgviD(const double *__A, vDSP_Stride __IA, double *__C, vDSP_Length *__I, vDSP_Length __N);`](/documentation/Accelerate/vDSP_maxmgviD)

Calculates the maximum magnitude and corresponding index in 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)