multiply(_:_:)
Returns the double-precision element-wise product of two vectors.
Declaration
static func multiply<T, U>(_ vectorA: T, _ vectorB: U) -> [Double] where T : AccelerateBuffer, U : AccelerateBuffer, T.Element == Double, U.Element == DoubleParameters
- vectorA:
The first input vector,
A. - vectorB:
The second input vector,
B.
Return Value
The output vector, C.
Discussion
This function calculates the products of the first N elements of input vectors A and B, and writes the result to output vector C.
for (n = 0; n < N; ++n)
C[n] = A[n] * B[n];[Image]
The following code shows an example of using this function:
let a: [Double] = [10, 20, 30, 40, 50]
let b: [Double] = [ 1, 2, 3, 4, 5]
let c = vDSP.multiply(a, b)
// Prints "[10.0, 40.0, 90.0, 160.0, 250.0]".
print(c)See Also
Multiplication
multiply(_:_:)multiply(_:_:)multiply(_:_:)multiply(_:_:result:)multiply(_:_:result:)multiply(_:_:result:)multiply(_:_:result:)multiply(_:by:count:useConjugate:result:)multiply(_:by:count:useConjugate:result:)multiply(_:by:result:)multiply(_:by:result:)multiply(addition:_:)multiply(addition:_:)multiply(addition:_:)multiply(addition:_:)