maximumMagnitude(_:)
Returns the double-precision maximum magnitude of a vector.
Declaration
static func maximumMagnitude<U>(_ vector: U) -> Double where U : AccelerateBuffer, U.Element == DoubleParameters
- 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: [Double] = [-1.5, 2.25, 3.6,
0.2, -0.1, -4.3]
let maximumMagnitude = vDSP.maximumMagnitude(a)
print("maximumMagnitude", maximumMagnitude) // Prints "maximumMagnitude 4.3".