vSgemv(_:_:_:_:_:_:_:_:)
Multiplies a vector by a scalar. Multiplies a matrix by another scalar, then by a second vector, and adds the resulting vector to the first vector. This function can also perform the calculation with the transpose of the original matrix instead of the matrix itself. A selector parameter determines whether the transpose is used.
Declaration
func vSgemv(_ forma: CChar, _ m: Int32, _ n: Int32, _ alpha: Float, _ a: UnsafePointer<vFloat>, _ x: UnsafePointer<vFloat>, _ beta: Float, _ y: UnsafeMutablePointer<vFloat>)Parameters
- forma:
Selects the variant computation to be performed: ‘T’ causes the transpose of matrix
ato be used, ‘N’ causesaitself to be used. - m:
Number of rows in
a. Ifforma= ‘N’,mis the length of vectory; ifforma= ‘T’,mis the length of vectorx; must be a multiple of 4. - n:
Number of columns in
a. Ifforma= ‘N’,mis the length of vectorx; ifforma= ‘T’,mis the length of vectory; must be a multiple of 4. - alpha:
Scalar multiplier for matrix
a. - a:
mbynmatrix with elements of typefloat. - x:
Vector with elements of type
float. - beta:
Scalar multiplier for vector
y. - y:
Destination vector with
nelements of typefloat.
Discussion
Vector y is multiplied by beta. Matrix a is multiplied by alpha. Then if forma = ‘N’, a is multiplied by vector x; if forma = ‘T’, the transpose of a is multiplied by x. The resulting vector is added to vector y, and the results are stored in y.