188 SUBROUTINE cgemm(TRANSA,TRANSB,M,N,K,ALPHA,A,LDA,B,LDB,BETA,C,LDC)
197 INTEGER k,lda,ldb,ldc,m,n
198 CHARACTER transa,transb
201 COMPLEX a(lda,*),b(ldb,*),c(ldc,*)
218 INTEGER i,info,j,l,ncola,nrowa,nrowb
219 LOGICAL conja,conjb,nota,notb
223 parameter(one= (1.0e+0,0.0e+0))
225 parameter(zero= (0.0e+0,0.0e+0))
234 nota =
lsame(transa,
'N')
235 notb =
lsame(transb,
'N')
236 conja =
lsame(transa,
'C')
237 conjb =
lsame(transb,
'C')
254 IF ((.NOT.nota) .AND. (.NOT.conja) .AND.
255 + (.NOT.
lsame(transa,
'T')))
THEN
257 ELSE IF ((.NOT.notb) .AND. (.NOT.conjb) .AND.
258 + (.NOT.
lsame(transb,
'T')))
THEN
260 ELSE IF (m.LT.0)
THEN
262 ELSE IF (n.LT.0)
THEN
264 ELSE IF (k.LT.0)
THEN
266 ELSE IF (lda.LT.max(1,nrowa))
THEN
268 ELSE IF (ldb.LT.max(1,nrowb))
THEN
270 ELSE IF (ldc.LT.max(1,m))
THEN
274 CALL
xerbla(
'CGEMM ',info)
280 IF ((m.EQ.0) .OR. (n.EQ.0) .OR.
281 + (((alpha.EQ.zero).OR. (k.EQ.0)).AND. (beta.EQ.one))) return
285 IF (alpha.EQ.zero)
THEN
286 IF (beta.EQ.zero)
THEN
310 IF (beta.EQ.zero)
THEN
314 ELSE IF (beta.NE.one)
THEN
320 IF (b(l,j).NE.zero)
THEN
323 c(i,j) = c(i,j) + temp*a(i,l)
336 temp = temp + conjg(a(l,i))*b(l,j)
338 IF (beta.EQ.zero)
THEN
341 c(i,j) = alpha*temp + beta*c(i,j)
353 temp = temp + a(l,i)*b(l,j)
355 IF (beta.EQ.zero)
THEN
358 c(i,j) = alpha*temp + beta*c(i,j)
369 IF (beta.EQ.zero)
THEN
373 ELSE IF (beta.NE.one)
THEN
379 IF (b(j,l).NE.zero)
THEN
380 temp = alpha*conjg(b(j,l))
382 c(i,j) = c(i,j) + temp*a(i,l)
392 IF (beta.EQ.zero)
THEN
396 ELSE IF (beta.NE.one)
THEN
402 IF (b(j,l).NE.zero)
THEN
405 c(i,j) = c(i,j) + temp*a(i,l)
420 temp = temp + conjg(a(l,i))*conjg(b(j,l))
422 IF (beta.EQ.zero)
THEN
425 c(i,j) = alpha*temp + beta*c(i,j)
437 temp = temp + conjg(a(l,i))*b(j,l)
439 IF (beta.EQ.zero)
THEN
442 c(i,j) = alpha*temp + beta*c(i,j)
456 temp = temp + a(l,i)*conjg(b(j,l))
458 IF (beta.EQ.zero)
THEN
461 c(i,j) = alpha*temp + beta*c(i,j)
473 temp = temp + a(l,i)*b(j,l)
475 IF (beta.EQ.zero)
THEN
478 c(i,j) = alpha*temp + beta*c(i,j)