Function

vDSP_meanv(_:_:_:_:)

Calculates the mean value in a single-precision vector.

Parameters

`__A`

Single-precision real input vector.

`__I`

Stride for `A`.

`__C`

Output scalar.

`__N`

The number of elements to process. If `N` is zero (`0`), this function returns `-INFINITY`.

Discussion

This function calculates the mean value of the first `N` elements of `A` and writes the result to `C`:

The operation is:

The following code shows an example of using `vDSP_meanv(_:_:_:_:)`:

Mean Calculation

`static func mean<U>(U) -> Double`

Returns the double-precision vector mean.

`static func mean<U>(U) -> Float`

Returns the single-precision vector mean.

`static func meanMagnitude<U>(U) -> Double`

Returns the double-precision vector mean magnitude.

`static func meanMagnitude<U>(U) -> Float`

Returns the single-precision vector mean magnitude.

`static func meanSquare<U>(U) -> Double`

Returns the double-precision vector mean square.

`static func meanSquare<U>(U) -> Float`

Returns the single-precision vector mean square.

`static func rootMeanSquare<U>(U) -> Double`

Returns double-precision vector root mean square.

`static func rootMeanSquare<U>(U) -> Float`

Returns single-precision vector root mean square.