DGEMMS(3S)DGEMMS(3S)NAMEDGEMMS - Multiplies a real general matrix by a real general matrix, using
Strassen's algorithm
SYNOPSIS
Fortran:
CALL DGEMMS (transa, transb, m, n, k, alpha, a, lda, b, ldb, beta,
c, ldc)
C/C++:
#include <scsl_blas.h>
void dgemms (char *transa, char *transb, int m, int n, int k, double
alpha, double *a, int lda, double *b, int ldb, double beta, 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.
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.
DESCRIPTIONDGEMMS multiplies a double precision general matrix by a double precision
general matrix.
This routine is an implementation of the Winograd's variation of
Strassen's algorithm for matrix multiplication. Because of a very
different order of operations performed by the Strassen's algorithm,
numerical results from DGEMMS may differ slightly from those of DGEMM.
DGEMMS is functionally equivalent to DGEMM, but it does require temporary
space which it allocates and manages automatically.
This routine performs one of the matrix-matrix operations:
C <- alpha op(A)op(B) + beta C
Page 1
DGEMMS(3S)DGEMMS(3S)
where op(X) is one of the following:
op(X) = X
op(X) = XT
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
* XT is the transpose of X
See the NOTES section of this man page for information about the
interpretation of the data types described in the following arguments.
This routine has 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) = AT
transa = 'C' or 'c': op(A) = AT
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) = BT
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.
Page 2
DGEMMS(3S)DGEMMS(3S)
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 Double precision. (input)
Scalar factor.
a Double precision array of dimension (lda,ka). (input)
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
(sub)program. When transa = 'N' or 'n', lda >= MAX(1,m);
otherwise, lda >= MAX(1,k).
b Double precision array of dimension (ldb,kb). (input)
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
(sub)program.
When transb = 'N' or 'n', ldb >= MAX(1,k); otherwise, ldb >=
MAX(1,n).
beta Double precision. (input)
Scalar factor. When beta is supplied as 0, c need not be set
on input.
c Double precision array of dimension (ldc,n). (input and
output)
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.
Page 3
DGEMMS(3S)DGEMMS(3S)
ldc Integer. (input)
Specifies the first dimension of c as declared in the calling
(sub)program. ldc >= MAX(1,m).
NOTES
This routine is an extension to the Level 3 BLAS.
This routine is a modified version of the package developed through the
PRISM project for multiplying matrices using Strassen's algorithm.
Please see http://www.mcs.anl.gov/Projects/PRISM for more details.
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])
Double precision DOUBLE PRECISION
C/C++:
Array of dimensions (m, n) x[m*n]
Character char
Integer int (long long for -lscs_i8[_mp])
Double precision 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
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 ALSOINTRO_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 4
DGEMMS(3S)DGEMMS(3S)DGEMM(3S), SGEMM(3S) to multiply general matrices by using the more
standard inner product algorithm
Page 5