Contents

maximumMagnitude(_:)

Returns the single-precision maximum magnitude of a vector.

Declaration

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

Parameters

  • vector:

    The input vector.

Return Value

The maximum magnitude of the vector.

Discussion

This function calculates the maximum magnitude of the first N elements of input vector A, and writes the result to output scalar C.

[Image]

The following code shows an example of using this function:

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

let maximumMagnitude = vDSP.maximumMagnitude(a)
print("maximumMagnitude", maximumMagnitude) // Prints "maximumMagnitude 4.3"

See Also

Type Methods