1 SUBROUTINE zgemm ( TRANSA, TRANSB, M, N, K, ALPHA, A, LDA, B, LDB,
4 CHARACTER*1 TRANSA, TRANSB
5 INTEGER M, N, K, LDA, LDB, LDC
8 COMPLEX*16 A( LDA, * ), B( LDB, * ), C( LDC, * )
137 INTRINSIC dconjg, max
139 LOGICAL CONJA, CONJB, NOTA, NOTB
140 INTEGER I, INFO, J, L, NCOLA, NROWA, NROWB
144 parameter( one = ( 1.0d+0, 0.0d+0 ) )
146 parameter( zero = ( 0.0d+0, 0.0d+0 ) )
156 nota = lsame( transa,
'N' )
157 notb = lsame( transb,
'N' )
158 conja = lsame( transa,
'C' )
159 conjb = lsame( transb,
'C' )
176 IF( ( .NOT.nota ).AND.
177 $ ( .NOT.conja ).AND.
178 $ ( .NOT.lsame( transa,
'T' ) ) )
THEN
180 ELSE IF( ( .NOT.notb ).AND.
181 $ ( .NOT.conjb ).AND.
182 $ ( .NOT.lsame( transb,
'T' ) ) )
THEN
184 ELSE IF( m .LT.0 )
THEN
186 ELSE IF( n .LT.0 )
THEN
188 ELSE IF( k .LT.0 )
THEN
190 ELSE IF( lda.LT.max( 1, nrowa ) )
THEN
192 ELSE IF( ldb.LT.max( 1, nrowb ) )
THEN
194 ELSE IF( ldc.LT.max( 1, m ) )
THEN
198 CALL xerbla(
'ZGEMM ', info )
204 IF( ( m.EQ.0 ).OR.( n.EQ.0 ).OR.
205 $ ( ( ( alpha.EQ.zero ).OR.( k.EQ.0 ) ).AND.( beta.EQ.one ) ) )
210 IF( alpha.EQ.zero )
THEN
211 IF( beta.EQ.zero )
THEN
220 c( i, j ) = beta*c( i, j )
235 IF( beta.EQ.zero )
THEN
239 ELSE IF( beta.NE.one )
THEN
241 c( i, j ) = beta*c( i, j )
245 IF( b( l, j ).NE.zero )
THEN
246 temp = alpha*b( l, j )
248 c( i, j ) = c( i, j ) + temp*a( i, l )
261 temp = temp + dconjg( a( l, i ) )*b( l, j )
263 IF( beta.EQ.zero )
THEN
264 c( i, j ) = alpha*temp
266 c( i, j ) = alpha*temp + beta*c( i, j )
278 temp = temp + a( l, i )*b( l, j )
280 IF( beta.EQ.zero )
THEN
281 c( i, j ) = alpha*temp
283 c( i, j ) = alpha*temp + beta*c( i, j )
294 IF( beta.EQ.zero )
THEN
298 ELSE IF( beta.NE.one )
THEN
300 c( i, j ) = beta*c( i, j )
304 IF( b( j, l ).NE.zero )
THEN
305 temp = alpha*dconjg( b( j, l ) )
307 c( i, j ) = c( i, j ) + temp*a( i, l )
317 IF( beta.EQ.zero )
THEN
321 ELSE IF( beta.NE.one )
THEN
323 c( i, j ) = beta*c( i, j )
327 IF( b( j, l ).NE.zero )
THEN
328 temp = alpha*b( j, l )
330 c( i, j ) = c( i, j ) + temp*a( i, l )
346 $ dconjg( a( l, i ) )*dconjg( b( j, l ) )
348 IF( beta.EQ.zero )
THEN
349 c( i, j ) = alpha*temp
351 c( i, j ) = alpha*temp + beta*c( i, j )
363 temp = temp + dconjg( a( l, i ) )*b( j, l )
365 IF( beta.EQ.zero )
THEN
366 c( i, j ) = alpha*temp
368 c( i, j ) = alpha*temp + beta*c( i, j )
382 temp = temp + a( l, i )*dconjg( b( j, l ) )
384 IF( beta.EQ.zero )
THEN
385 c( i, j ) = alpha*temp
387 c( i, j ) = alpha*temp + beta*c( i, j )
399 temp = temp + a( l, i )*b( j, l )
401 IF( beta.EQ.zero )
THEN
402 c( i, j ) = alpha*temp
404 c( i, j ) = alpha*temp + beta*c( i, j )
subroutine xerbla(SRNAME, INFO)
subroutine zgemm(TRANSA, TRANSB, M, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC)