Function

vDSP_sve_svesqD(_:_:_:_:_:)

Calculates the sum of values and the sum of squares in a double-precision vector.

Declaration

func vDSP_sve_svesqD(_ __A: UnsafePointer<Double>, _ __IA: vDSP_Stride, _ __Sum: UnsafeMutablePointer<Double>, _ __SumOfSquares: UnsafeMutablePointer<Double>, _ __N: vDSP_Length)

Parameters

__A

Double-precision input vector.

__IA

Stride for the input vector.

__Sum

Double-precision sum (scalar) of the elements of A.

__SumOfSquares

Double-precision sum (scalar) of the squares of the elements of A.

__N

Number of elements in A.

Discussion

This function calculates the sum of values and the sum of squares of the first N elements of A and writes the result to Sum and SumOfSquares respectively:

A diagram showing the operation of the vDSP_sve_svesq function. There are three rows. The top row represents the input, vector A. The second row represents the summation operations. The bottom row represents the output, vector C. The diagram has connecting lines from the input vectors to the operation and from the operation to the output vector indicating the relationships between the input and output.

The operation is:

Sum          = sum(A[n],      0 <= n < N);
SumOfSquares = sum(A[n] ** 2, 0 <= n < N);

See Also

Vector Summation

static func sum<U>(U) -> Double

Returns the double-precision vector sum.

static func sum<U>(U) -> Float

Returns the single-precision vector sum.

static func sumAndSumOfSquares<U>(U) -> (elementsSum: Double, squaresSum: Double)

Returns the double-precision vector sum and sum of squares.

static func sumAndSumOfSquares<U>(U) -> (elementsSum: Float, squaresSum: Float)

Returns the single-precision vector sum and sum of squares.

static func sumOfMagnitudes<U>(U) -> Double

Returns the double-precision vector sum of magnitudes.

static func sumOfMagnitudes<U>(U) -> Float

Returns the single-precision vector sum of magnitudes.

static func sumOfSquares<U>(U) -> Double

Returns the double-precision vector sum of squares.

static func sumOfSquares<U>(U) -> Float

Returns the single-precision vector sum of squares.

func vDSP_svemg(UnsafePointer<Float>, vDSP_Stride, UnsafeMutablePointer<Float>, vDSP_Length)

Calculates the sum of magnitudes in a single-precision vector.

func vDSP_svs(UnsafePointer<Float>, vDSP_Stride, UnsafeMutablePointer<Float>, vDSP_Length)

Calculates the sum of signed squares in a single-precision vector.

func vDSP_svsD(UnsafePointer<Double>, vDSP_Stride, UnsafeMutablePointer<Double>, vDSP_Length)

Calculates the sum of signed squares in a double-precision vector.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software