CGEMM3M(3S)CGEMM3M(3S)NAME
CGEMM3M, ZGEMM3M - Multiplies a complex general matrix by a complex
general matrix
SYNOPSIS
Single precision complex
Fortran:
CALL CGEMM3M (transa, transb, m, n, k, alpha, a, lda, b, ldb,
beta, c, ldc)
C/C++:
#include <scsl_blas.h>
void cgemm3m (char *transa, char *transb, int m, int n, int k,
scsl_complex *alpha, scsl_complex *a, int lda, scsl_complex *b,
int ldb, scsl_complex *beta, scsl_complex *c, int ldc);
C++ STL:
#include <complex.h>
#include <scsl_blas.h>
void cgemm3m (char *transa, char *transb, int m, int n, int k,
complex<float> *alpha, complex<float> *a, int lda,
complex<float> *b, int ldb, complex<float> *beta,
complex<float> *c, int ldc);
Double precision complex
Fortran:
CALL ZGEMM3M (transa, transb, m, n, k, alpha, a, lda, b, ldb,
beta, c, ldc)
C/C++:
#include <scsl_blas.h>
void zgemm3m (char *transa, char *transb, int m, int n, int k,
scsl_zomplex *alpha, scsl_zomplex *a, int lda, scsl_zomplex *b,
int ldb, scsl_zomplex *beta, scsl_zomplex *c, int ldc);
C++ STL:
#include <complex.h>
#include <scsl_blas.h>
void zgemm3m (char *transA, char *transB, int m, int n, int k,
complex<double> *alpha, complex<double> *a, int lda,
complex<double> *b, int ldb, complex<double> *beta,
complex<double> *c, int ldc);
IMPLEMENTATION
These routines are part of the SCSL Scientific Library and can be loaded
using either the -lscs or the -lscs_mp option. The -lscs_mp option
directs the linker to use the multi-processor version of the library.
Page 1
CGEMM3M(3S)CGEMM3M(3S)
When linking to SCSL with -lscs or -lscs_mp, the default integer size is
4 bytes (32 bits). Another version of SCSL is available in which integers
are 8 bytes (64 bits). This version allows the user access to larger
memory sizes and helps when porting legacy Cray codes. It can be loaded
by using the -lscs_i8 option or the -lscs_i8_mp option. A program may use
only one of the two versions; 4-byte integer and 8-byte integer library
calls cannot be mixed.
The C and C++ prototypes shown above are appropriate for the 4-byte
integer version of SCSL. When using the 8-byte integer version, the
variables of type int become long long and the <scsl_blas_i8.h> header
file should be included.
DESCRIPTION
CGEMM3M and ZGEMM3M multiply a complex general matrix by a complex
general matrix.
These routines perform one of the matrix-matrix operations:
C <- alpha op(A)op(B) + beta C
where op(X) is one of the following:
op(X) = X
op(X) = XT
op(X) = XH
where
* alpha and beta are scalars
* A, B, and C are matrices
* op(A) is an m-by-k matrix
* op(B) is a k-by-n matrix
* C is an m-by-n matrix.
* X T is the transpose of x
* XH is the conjugate transpose of X.
The CGEMM3M and ZGEMM3M routines use an algorithm requiring 3 real matrix
multiplications and 5 real matrix additions to compute the complex matrix
product; CGEMM(3S) and ZGEMM(3S) use 4 real matrix multiplications and 2
real matrix additions. Because the matrix multiplication time is usually
the limiting performance factor in these routines, CGEMM3M and ZGEMM3M
may run up to 33 percent faster than CGEMM and ZGEMM. Because of other
overhead associated with the 3M routines, however, these performance
Page 2
CGEMM3M(3S)CGEMM3M(3S)
improvements may not always be realized. For example, on one processor
the 3M routines will generally run more slowly than the standard complex
matrix multiplication routines when m * n * k < FACTOR, where m, n, and k
are the input matrix dimensions and FACTOR is approximately 200000 for
CGEMM3M and 325000 for ZGEMM3M.
See the NOTES section of this man page for information about the
interpretation of the data types described in the following arguments.
These routines have the following arguments:
transa Character. (input)
Specifies the form of op(A) to be used in the matrix
multiplication, as follows:
transa = 'N' or 'n': op(A) = A
transa = 'T' or 't': op(A) = A T
transa = 'C' or 'c': op(A) = AH
For C/C++, a pointer to this character is passed.
transb Character. (input)
Specifies the form of op(B) to be used in the matrix
multiplication, as follows:
transb = 'N' or 'n': op(B) = B
transb = 'T' or 't': op(B) = BT
transb = 'C' or 'c': op(B) = BH
For C/C++, a pointer to this character is passed.
m Integer. (input)
Specifies the number of rows in matrix op(A) and in matrix C.
m must be >= 0.
n Integer. (input)
Specifies the number of columns in matrix op(B) and in matrix
C. n must be >= 0.
k Integer. (input)
Specifies the number of columns of matrix op(A) and the number
of rows of matrix op(B). k must be >= 0.
alpha First scalar factor. (input)
CGEMM3M: Single precision complex.
ZGEMM3M: Double precision complex.
Page 3
CGEMM3M(3S)CGEMM3M(3S)
For C/C++, a pointer to this scalar is passed.
a Array of dimension (lda,ka). (input)
CGEMM3M: Single precision complex array.
ZGEMM3M: Double precision complex array.
When transa = 'N' or 'n', ka is k; otherwise, it is m.
Contains the matrix A.
Before entry with transa = 'N' or 'n', the leading m-by-k part
of array a must contain matrix A; otherwise, the leading k-by-m
part of array a must contain matrix A.
lda Integer. (input)
Specifies the first dimension of a as declared in the calling
program.
When transa = 'N' or 'n', lda >= MAX(1,m); otherwise, lda >=
MAX(1,k).
b Array of dimension (ldb,kb). (input)
CGEMM3M: Single precision complex array.
ZGEMM3M: Double precision complex array.
When transb = 'N' or 'n', kb is n; otherwise, it is k.
Contains the matrix B.
Before entry with transb = 'N' or 'n', the leading k-by-n part
of array b must contain matrix B; otherwise, the leading n-by-k
part of array b must contain matrix B.
ldb Integer. (input)
Specifies the first dimension of b as declared in the calling
program. When transb = 'N' or 'n', ldb >= MAX(1,k); otherwise,
ldb >= MAX(1,n).
beta Scalar factor. (input)
CGEMM3M: Single precision complex.
ZGEMM3M: Double precision complex.
When beta is supplied as 0, c need not be set on input.
For C/C++, a pointer to this scalar is passed.
c Array of dimension (ldc,n). (input and output)
CGEMM3M: Single precision complex array.
ZGEMM3M: Double precision complex array.
Contains the matrix C.
Before entry, the leading m-by-n part of array c must contain
matrix C, except when beta is 0; in which case, c need not be
set. On exit, the m-by-n result matrix overwrites array c.
ldc Integer. (input)
Page 4
CGEMM3M(3S)CGEMM3M(3S)
Specifies the first dimension of c as declared in the calling
program. ldc >= MAX(1,m).
NOTES
These routines are Level 3 Basic Linear Algebra Subprograms (Level 3
BLAS).
Data Types
The following data types are described in this documentation:
Term Used Data type
Fortran:
Array of dimensions (m,n) x(m,n)
Character CHARACTER
Integer INTEGER (INTEGER*8 for -lscs_i8[_mp])
Single precision complex COMPLEX
Double precision complex DOUBLE COMPLEX
C/C++:
Array of dimensions (m,n) x[m*n]
Character char
Integer int (long long for -lscs_i8[_mp])
Single precision complex scsl_complex
Double precision complex scsl_zomplex
C++ STL:
Array of dimensions (m,n) x[m*n]
Character char
Integer int (long long for -lscs_i8[_mp])
Single precision complex complex<float>
Double precision complex complex<double>
Note that you can explicitly declare multidimensional C/C++ arrays
provided that the array dimensions are swapped with respect to the
Fortran declaration (e.g., x[n][m] in C/C++ versus x(m,n) in Fortran).
To avoid a compiler type mismatch error in C++ (or a compiler warning
Page 5
CGEMM3M(3S)CGEMM3M(3S)
message in C), however, the array should be cast to a pointer of the
appropriate type when passed as an argument to a SCSL routine.
SEE ALSODGEMMS(3S) to multiply general matrices by using Strassen's algorithm
SGEMM(3S), INTRO_SCSL(3S), INTRO_BLAS3(3S)INTRO_CBLAS(3S) for information about using the C interface to Fortran 77
Basic Linear Algebra Subprograms (legacy BLAS) set forth by the Basic
Linear Algebra Subprograms Technical Forum.
Page 6