Generic Type Method

maximum(_:)

Returns the maximum element of a double-precision vector.

Declaration

static func maximum<U>(_ vector: U) -> Double where U : AccelerateBuffer, U.Element == Double

Parameters

vector

The vector to query.

Discussion

This function calculates and returns the maximum value in a supplied vector.

The following is an example of using maximum(_:).

let a: [Double] = [-1.5, 2.25, 3.6,
                   0.2, -0.1, -4.3]

let maximum = vDSP.maximum(a)
print("maximum", maximum) // Prints "maximum 3.6"

See Also

Maximum Calculation

static func maximum<U>(U) -> Float

Returns the maximum element of a single-precision vector.

static func maximumMagnitude<U>(U) -> Double

Returns the maximum magnitude element of a double-precision vector.

static func maximumMagnitude<U>(U) -> Float

Returns the maximum magnitude element of a single-precision vector.

static func indexOfMaximum<U>(U) -> (UInt, Double)

Returns the maximum element, and its index, of a double-precision vector.

static func indexOfMaximum<U>(U) -> (UInt, Float)

Returns the maximum element, and its index, of a signal-precision vector.

static func indexOfMaximumMagnitude<U>(U) -> (UInt, Double)

Returns the maximum magnitude element, and its index, of a double-precision vector.

static func indexOfMaximumMagnitude<U>(U) -> (UInt, Float)

Returns the maximum magnitude element, and its index, of a single-precision vector.

func vDSP_maxmgv(UnsafePointer<Float>, vDSP_Stride, UnsafeMutablePointer<Float>, vDSP_Length)

Calculates the maximum magnitude in a single-precision vector.

func vDSP_maxmgvi(UnsafePointer<Float>, vDSP_Stride, UnsafeMutablePointer<Float>, UnsafeMutablePointer<vDSP_Length>, vDSP_Length)

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