Function

cblas_sgemm(_:_:_:_:_:_:_:_:_:_:_:_:_:_:)

Multiplies two matrices (single-precision).

Parameters

Order

Specifies row-major (C) or column-major (Fortran) data ordering.

TransA

Specifies whether to transpose matrix A.

TransB

Specifies whether to transpose matrix B.

M

Number of rows in matrices A and C.

N

Number of columns in matrices B and C.

K

Number of columns in matrix A; number of rows in matrix B.

alpha

Scaling factor for the product of matrices A and B.

A

Matrix A.

lda

The size of the first dimention of matrix A; if you are passing a matrix A[m][n], the value should be m.

B

Matrix B.

ldb

The size of the first dimention of matrix B; if you are passing a matrix B[m][n], the value should be m.

beta

Scaling factor for matrix C.

C

Matrix C.

ldc

The size of the first dimention of matrix C; if you are passing a matrix C[m][n], the value should be m.

Discussion

This function multiplies A * B and multiplies the resulting matrix by alpha. It then multiplies matrix C by beta. It stores the sum of these two products in matrix C.

Thus, it calculates either

C←αAB + βC

or

C←αBA + βC

with optional use of transposed forms of A, B, or both.

Single-Precision Float Matrix Functions

func cblas_sasum(Int32, UnsafePointer<Float>!, Int32) -> Float

Computes the sum of the absolute values of elements in a vector (single-precision).

func cblas_saxpy(Int32, Float, UnsafePointer<Float>!, Int32, UnsafeMutablePointer<Float>!, Int32)

Computes a constant times a vector plus a vector (single-precision).

func cblas_snrm2(Int32, UnsafePointer<Float>!, Int32) -> Float

Computes the L2 norm (Euclidian length) of a vector (single precision).

func cblas_sscal(Int32, Float, UnsafeMutablePointer<Float>!, Int32)

Multiplies each element of a vector by a constant (single-precision).

func cblas_sspmv(CBLAS_ORDER, CBLAS_UPLO, Int32, Float, UnsafePointer<Float>!, UnsafePointer<Float>!, Int32, Float, UnsafeMutablePointer<Float>!, Int32)

Scales a packed symmetric matrix, then multiplies by a vector, then scales and adds another vector (single precision).

func cblas_sspr(CBLAS_ORDER, CBLAS_UPLO, Int32, Float, UnsafePointer<Float>!, Int32, UnsafeMutablePointer<Float>!)

Rank one update: adds a packed symmetric matrix to the product of a scaling factor, a vector, and its transpose (single precision).

func cblas_ssymv(CBLAS_ORDER, CBLAS_UPLO, Int32, Float, UnsafePointer<Float>!, Int32, UnsafePointer<Float>!, Int32, Float, UnsafeMutablePointer<Float>!, Int32)

Scales a symmetric matrix, multiplies by a vector, then scales and adds another vector (single precision).

func cblas_ssyr(CBLAS_ORDER, CBLAS_UPLO, Int32, Float, UnsafePointer<Float>!, Int32, UnsafeMutablePointer<Float>!, Int32)

Rank one update: adds a symmetric matrix to the product of a scaling factor, a vector, and its transpose (single precision).

func cblas_ssyrk(CBLAS_ORDER, CBLAS_UPLO, CBLAS_TRANSPOSE, Int32, Int32, Float, UnsafePointer<Float>!, Int32, Float, UnsafeMutablePointer<Float>!, Int32)

Rank-k update—multiplies a symmetric matrix by its transpose and adds a second matrix (single precision).