Function

vDSP_vamD

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

Declaration

void vDSP_vamD(const double *__A, vDSP_Stride __IA, const double *__B, vDSP_Stride __IB, const double *__C, vDSP_Stride __IC, double *__D, vDSP_Stride __IDD, vDSP_Length __N);

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 vector.

__IC

Stride for C

__D

Double-precision real output vector.

__ID

Stride for D.

__N

Number of elements to add.

Discussion

This function calculates the sums of the first N elements of A and B, multiplies each sum by the corresponding value in C, and writes the result to D:

A diagram showing the operation of the vDSP_vam 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, vector C. The bottom row represents the output, vector D. 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)
    D[n] = (A[n] + B[n]) * C[n];

See Also

Ternary Add-Multiply Operations

vDSP_vam

Multiplies a single-precision vector by the sum of two single-precision vectors.