<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/vDSP/indexOfMinimum(_:)-989q3",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "s:10Accelerate4vDSPO14indexOfMinimumySu_SftxAA0A6BufferRzSf7ElementRtzlFZ"
  },
  "title" : "indexOfMinimum(_:)"
}
-->

# indexOfMinimum(_:)

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

```
static func indexOfMinimum<U>(_ vector: U) -> (UInt, Float) where U : AccelerateBuffer, U.Element == Float
```

## Parameters

`vector`

The input vector.

## Return Value

A tuple that contains the minimum value and corresponding index.

## Discussion

This function calculates the minimum value and its corresponding index of the first `N` elements of the input vector and writes the results to the output scalar parameters, `C` and `I`, respectively.

![A diagram showing the operation of this function. There are three rows. The top row represents the input vector, A, with three boxes. The middle row represents the operation as two boxes that contains minimum and argmin functions. The bottom row represents the output scalar values C and I as two  boxes. The diagram has connecting lines from the input vector to the operations, and from the operations to the output scalar values.](images/com.apple.accelerate/media-4465979@2x.png)

The following code shows an example of using this function:

```swift
let a: [Float] = [-1.5, 2.25, 3.6,
                  0.2, -0.1, -4.3]

let indexOfMinimum = vDSP.indexOfMinimum(a)
print("indexOfMinimum", indexOfMinimum) // Prints "indexOfMinimum (5, -4.3)".
```

---

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)