HP MLIB User's Guide Vol. 1 7th Ed.

222 HP MLIB User’s Guide
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-k matrix, and B is a k-by-n matrix. Optionally, A can be replaced by A
T
or
A*, where A is a k-by-m matrix, and B can be replaced by B
T
or B*, where B is
an n-by-k matrix. Here, A
T
and B
T
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:
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)
C ←αAB C,
C ←αA
T
B C,
C ←αA
B C,
C ←αAB
T
C, C ←αA
T
B
T
C,
C ←αA
B
T
C,
C ←αAB
C, C ←αA
T
B
C, C ←αA
B
C.