188 SUBROUTINE sgemm(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 REAL a(lda,*),b(ldb,*),c(ldc,*)
218 INTEGER i,info,j,l,ncola,nrowa,nrowb
223 parameter(one=1.0e+0,zero=0.0e+0)
230 nota =
lsame(transa,
'N')
231 notb =
lsame(transb,
'N')
248 IF ((.NOT.nota) .AND. (.NOT.
lsame(transa,
'C')) .AND.
249 + (.NOT.
lsame(transa,
'T')))
THEN
251 ELSE IF ((.NOT.notb) .AND. (.NOT.
lsame(transb,
'C')) .AND.
252 + (.NOT.
lsame(transb,
'T')))
THEN
254 ELSE IF (m.LT.0)
THEN
256 ELSE IF (n.LT.0)
THEN
258 ELSE IF (k.LT.0)
THEN
260 ELSE IF (lda.LT.max(1,nrowa))
THEN
262 ELSE IF (ldb.LT.max(1,nrowb))
THEN
264 ELSE IF (ldc.LT.max(1,m))
THEN
268 CALL
xerbla(
'SGEMM ',info)
274 IF ((m.EQ.0) .OR. (n.EQ.0) .OR.
275 + (((alpha.EQ.zero).OR. (k.EQ.0)).AND. (beta.EQ.one))) return
279 IF (alpha.EQ.zero)
THEN
280 IF (beta.EQ.zero)
THEN
304 IF (beta.EQ.zero)
THEN
308 ELSE IF (beta.NE.one)
THEN
314 IF (b(l,j).NE.zero)
THEN
317 c(i,j) = c(i,j) + temp*a(i,l)
330 temp = temp + a(l,i)*b(l,j)
332 IF (beta.EQ.zero)
THEN
335 c(i,j) = alpha*temp + beta*c(i,j)
346 IF (beta.EQ.zero)
THEN
350 ELSE IF (beta.NE.one)
THEN
356 IF (b(j,l).NE.zero)
THEN
359 c(i,j) = c(i,j) + temp*a(i,l)
372 temp = temp + a(l,i)*b(j,l)
374 IF (beta.EQ.zero)
THEN
377 c(i,j) = alpha*temp + beta*c(i,j)