vSndot(_:_:_:_:_:_:)
Computes the dot products of n pairs of vectors, accumulating or storing the results in an array of n float values.
Declaration
func vSndot(_ n: Int32, _ m: Int32, _ s: UnsafeMutablePointer<Float>, _ isw: Int32, _ x: UnsafePointer<vFloat>, _ y: UnsafePointer<vFloat>)Parameters
- n:
Number of dot products to compute, and number of elements in vector
s; must be a multiple of 4. - m:
Number of elements in the vectors whose dot products are computed; must be a multiple of 4.
- s:
Destination vector; the
ndot products are accumulated or stored here. - isw:
A key that selects one of the four variants of this function: see Discussion below.
- x:
A matrix whose rows are
nfloating-point vectors, each containingmvalues. - y:
A second matrix whose rows are
nfloating-point vectors, each containingmvalues.
Discussion
For i = 0 to n-1, the dot product of vectors x[i] and y[i] is computed. The dot product is accumulated or stored in s[i], according to the value of isw:
if
isw= 1, the dot product is stored ins[i].if
isw= 2, the dot product is negated and then stored ins[i].if
isw= 3, the dot product is added to the value ins[i].if
isw= 4, the dot product is negated and then added to the value ins[i].