Function

vDSP_vmsaD(_:_:_:_:_:_:_:_:)

Multiplies the sum of two double-precision vectors by a double-precision scalar value.

Declaration

func vDSP_vmsaD(_ __A: UnsafePointer<Double>, _ __IA: vDSP_Stride, _ __B: UnsafePointer<Double>, _ __IB: vDSP_Stride, _ __C: UnsafePointer<Double>, _ __D: UnsafeMutablePointer<Double>, _ __ID: vDSP_Stride, _ __N: vDSP_Length)

Parameters

__A

Double-precision real input vector.

__IA

Stride for A.

__B

Double-precision real input vector.

__IB

Stride for B.

__C

Double-precision real input scalar.

__D

Double-precision real output vector.

__ID

Stride for D.

__N

The number of elements to process.

Discussion

This function calculates the products of the first N elements of A and B, adds each product to the scalar value C, and writes the result to D:

A diagram showing the operation of the vDSP_vmsa function. There are five rows. The top two rows represents the first two inputs, vector A and vector B. The third row represents the intermediate result of the first two inputs. The forth row represents the third input, scalar C. The bottom row represents the output, vector D. The diagram has connecting lines from the inputs to the output vector indicating the relationships between the inputs and output.

The operation is:

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

See Also

Ternary (Vector-Vector-Scalar) Multiply-Add Operations

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