Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

SGEMM(3dxml)  —  Subroutines

Name

sgemm, dgemm, cgemm, zgemm − Matrix-matrix product and addition

FORMAT

{S,D,C,Z}GEMM ( transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc )

Arguments

transacharacter∗1
On entry, specifies the form of (op)A used in the matrix multiplication:

If transa = ’N’ or ’n’, (op)A = A

If transa = ’T’ or ’t’, (op)A = transp(A)

If transa = ’R’ or ’r’, (op)A = conjugate(A)

If transa = ’C’ or ’c’, (op)A = conjug_transp(A)
On exit, transa is unchanged. 

transbcharacter∗1
On entry, specifies the form of (op)B used in the matrix multiplication:

If transb = ’N’ or ’n’, (op)B = B

If transb = ’T’ or ’t’, (op)B = transp(B)

If transb = ’R’ or ’r’, (op)B = conjugate(B)

If transb = ’C’ or ’c’, (op)B = conjug_transp(B)

minteger∗4
On entry, the number of rows of the matrix (op)A and of the matrix C; m >= 0
On exit, m is unchanged. 

ninteger∗4
On entry, the number of columns of the matrix (op)B and of the matrix C; n >= 0
On exit, n is unchanged. 

kinteger∗4
On entry, the number of columns of the matrix (op)A and the number of rows of the matrix (op)B; k >= 0
On exit, k is unchanged. 

alphareal∗4 | real∗8 | complex∗8 | complex∗16
On entry, specifies the scalar alpha.
On exit, alpha is unchanged. 

areal∗4 | real∗8 | complex∗8 | complex∗16
On entry, a two-dimensional array A with dimensions lda by ka.
For (op)A = A  or  conjugate(A), ka >= k and the leading m by k portion of the array A contains the matrix A.
For (op)A = transp(A)   or conjug_transp(A), ka >= m and the leading k by m part of the array A contains the matrix A.
On exit, a is unchanged. 

ldainteger∗4
On entry, the first dimension of array A.
For (op)A = A  or conjugate(A), lda >= MAX(1,m).
For (op)A = transp(A)  or conjug_transp(A), lda >= MAX(1,k).
On exit, lda is unchanged. 

breal∗4 | real∗8 | complex∗8 | complex∗16
On entry, a two-dimensional array B with dimensions ldb by kb.
For (op)B = B or conjugate(B), kb >= n and the leading k by n portion of the array contains the matrix B.
For (op)B = transp(B) or conjug_transp(B), kb >= k and the leading n by k part of the array contains the matrix B.
On exit, b is unchanged. 

ldbinteger∗4
On entry, the first dimension of array B.
For (op)B = B or <conjugate(B), ldb >= MAX(1,k).
For (op)B = transp(B) or conjug_transp(B), ldb >= MAX(1,n).
On exit, ldb is unchanged. 

betareal∗4 | real∗8 | complex∗8 | complex∗16
On entry, specifies the scalar beta.
On exit, beta is unchanged. 

creal∗4 | real∗8 | complex∗8 | complex∗16
On entry, a two-dimensional array with the dimension ldc by at least n.
On exit,  the leading  m by n part of array C is overwritten by the matrix alpha∗(op)A∗(op)B + beta∗C.

ldcinteger∗4
On entry, the first dimension  of array C; ldc >= MAX(1,m)
On exit, ldc is unchanged. 

Description

The _GEMM routines perform the following operations: C  = alpha(op)A(op)B + beta∗C
where (op)(X) = X, transp(X), conjugate(X),  or conjug_transp(X), alpha and beta are scalars, and A, B, and C are matrices. (op)A is an m by k matrix, (op)B is a k by n matrix, and C is an m by n matrix.

Example

REAL∗4 A(20,40), B(20,30), C(40,30), alpha, beta
M = 10
N = 20
K = 15
LDA = 20
LDB = 20
LDC = 40
alpha = 2.0
beta = 2.0
CALL SGEMM (’T’,’N’,M,N,K,alpha,A,LDA,B,LDB,beta,C,LDC)

This FORTRAN code computes the product C  =  alpha ∗ transp(A)∗B + beta∗C where A is a real general matrix. A is a 15 by 10 real general matrix embedded in array A. B is a 15 by 20 real general matrix embedded in array B. C is a  10 by 20 real general matrix embedded in array C.

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026