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