Contents

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 n dot 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 n floating-point vectors, each containing m values.

  • y:

    A second matrix whose rows are n floating-point vectors, each containing m values.

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 in s[i].

  • if isw = 2, the dot product is negated and then stored in s[i].

  • if isw = 3, the dot product is added to the value in s[i].

  • if isw = 4, the dot product is negated and then added to the value in s[i].

See Also

Vector-Scalar Linear Algebra Functions (from vectorOps.h)