SGEMM/DGEMM/CGEMM/ZGEMM

Matrix-matrix multiply

Name SGEMM/DGEMM/CGEMM/ZGEMM

Matrix-matrix multiply

Purpose These subprograms compute the matrix-matrix product AB, where A is an m-by-kmatrix, and B is a k-by-nmatrix. Optionally, A can be replaced by AT or A*, where A is a k-by-mmatrix, and B can be replaced by BT or B*, where B is

an n-by-kmatrix. Here, AT and BT are the transposes and A* and B* are the conjugate-transposes of A and B, respectively. The product can be stored in the result matrix (which is always of size m-by-n) or optionally can be added to or subtracted from it. This is handled in a convenient, but general, way by two scalar arguments, α and β, which are used as multipliers of the matrix product and the result matrix. Specifically, these subprograms compute matrix products of the forms:

C ← αAB + βC,

C

← α

T

B

+ β ,

C

← α

+ β ,

 

 

A

C

 

A B

C

C ← αABT + βC,

C ← αATBT + βC,

C ← αABT + βC,

C ← αAB+ βC,

C ← αATB+ βC,

C ← αAB+ βC.

Refer to “F_SGEMM/F_DGEMM/F_CGEMM/F_ZGEMM” on page 362 for a description of the BLAS Standard subprograms for general matrix-matrix multiply.

Usage

VECLIB:

 

 

CHARACTER*1

transa, transb

 

INTEGER*4

m, n, k, lda, ldb, ldc

 

REAL*4

alpha, beta, a(lda, *), b(ldb, *), c(ldc, n)

CALL SGEMM(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)

CHARACTER*1

transa, transb

INTEGER*4

m, n, k, lda, ldb, ldc

REAL*8

alpha, beta, a(lda, *), b(ldb, *), c(ldc, n)

CALL DGEMM(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)

CHARACTER*1

transa, transb

INTEGER*4

m, n, k, lda, ldb, ldc

COMPLEX*8

alpha, beta, a(lda, *), b(ldb, *), c(ldc, n)

CALL CGEMM(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)

CHARACTER*1

transa, transb

INTEGER*4

m, n, k, lda, ldb, ldc

COMPLEX*16

alpha, beta, a(lda, *), b(ldb, *), c(ldc, n)

CALL ZGEMM(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)

222HP MLIB User’s Guide