Function

vDSP_vsubD(_:_:_:_:_:_:_:)

Subtracts two double-precision vectors.

Declaration

func vDSP_vsubD(_ __B: UnsafePointer<Double>, _ __IB: vDSP_Stride, _ __A: UnsafePointer<Double>, _ __IA: vDSP_Stride, _ __C: UnsafeMutablePointer<Double>, _ __IC: vDSP_Stride, _ __N: vDSP_Length)

Parameters

__B

Double-precision real input vector.

__IB

Stride for B.

__A

Double-precision real input vector.

__IA

Stride for A.

__C

Double-precision real output vector.

__IC

Stride for C.

__N

Number of elements to subtract.

Discussion

This function calculates the differences of the first N elements of input vectors A and B, writing the result to output vector C:

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

The operation is:

 for (n = 0; n < N; ++n)
    C[n] = A[n] - B[n];