meanSquare(_:)
Returns the mean of squares of a single-precision vector.
Declaration
static func meanSquare<U>(_ vector: U) -> Float where U : AccelerateBuffer, U.Element == FloatParameters
- vector:
The source vector.
Discussion
This function calculates and returns the mean square of a supplied vector.
The following is an example of using meanSquare(_:):
let a: [Float] = [-8, -4, -2, 0, 2, 4, 8]
let mean = vDSP.meanSquare(a)
print(mean) // Prints "24.0".