meanMagnitude(_:)
Returns the mean of magnitudes of a double-precision vector.
Declaration
static func meanMagnitude<U>(_ vector: U) -> Double where U : AccelerateBuffer, U.Element == DoubleParameters
- vector:
The source vector.
Discussion
This function calculates and returns the mean magnitude of a supplied vector.
The following is an example of using meanMagnitude(_:):
let a: [Double] = [-8, -4, -2, 0, 2, 4, 8]
let mean = vDSP.meanMagnitude(a)
print(mean) // Prints "4.0".