{S,D,C,Z}GEMM ( transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc )
transa character*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. transb character*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) m integer*4 On entry, the number of rows of the matrix (op)A and of the matrix C; m >= 0 On exit, m is unchanged. n integer*4 On entry, the number of columns of the matrix (op)B and of the matrix C; n >= 0 On exit, n is unchanged. k integer*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. alpha real*4 | real*8 | complex*8 | complex*16 On entry, specifies the scalar alpha. On exit, alpha is unchanged. a real*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. lda integer*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. b real*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. ldb integer*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. beta real*4 | real*8 | complex*8 | complex*16 On entry, specifies the scalar beta. On exit, beta is unchanged. c real*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. ldc integer*4 On entry, the first dimension of array C; ldc >= MAX(1,m) On exit, ldc is unchanged.
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.
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.