1 SUBROUTINE dgemm ( TRANSA, TRANSB, M, N, K, ALPHA, A, LDA, B, LDB,
4 CHARACTER*1 TRANSA, TRANSB
5 INTEGER M, N, K, LDA, LDB, LDC
6 DOUBLE PRECISION ALPHA, BETA
8 DOUBLE PRECISION A( LDA, * ), B( LDB, * ), C( LDC, * )
140 INTEGER I, INFO, J, L, NCOLA, NROWA, NROWB
141 DOUBLE PRECISION TEMP
143 DOUBLE PRECISION ONE , ZERO
144 parameter( one = 1.0d+0, zero = 0.0d+0 )
152 nota = lsame( transa,
'N' )
153 notb = lsame( transb,
'N' )
170 IF( ( .NOT.nota ).AND.
171 $ ( .NOT.lsame( transa,
'C' ) ).AND.
172 $ ( .NOT.lsame( transa,
'T' ) ) )
THEN
174 ELSE IF( ( .NOT.notb ).AND.
175 $ ( .NOT.lsame( transb,
'C' ) ).AND.
176 $ ( .NOT.lsame( transb,
'T' ) ) )
THEN
178 ELSE IF( m .LT.0 )
THEN
180 ELSE IF( n .LT.0 )
THEN
182 ELSE IF( k .LT.0 )
THEN
184 ELSE IF( lda.LT.max( 1, nrowa ) )
THEN
186 ELSE IF( ldb.LT.max( 1, nrowb ) )
THEN
188 ELSE IF( ldc.LT.max( 1, m ) )
THEN
192 CALL xerbla(
'DGEMM ', info )
198 IF( ( m.EQ.0 ).OR.( n.EQ.0 ).OR.
199 $ ( ( ( alpha.EQ.zero ).OR.( k.EQ.0 ) ).AND.( beta.EQ.one ) ) )
204 IF( alpha.EQ.zero )
THEN
205 IF( beta.EQ.zero )
THEN
214 c( i, j ) = beta*c( i, j )
229 IF( beta.EQ.zero )
THEN
233 ELSE IF( beta.NE.one )
THEN
235 c( i, j ) = beta*c( i, j )
239 IF( b( l, j ).NE.zero )
THEN
240 temp = alpha*b( l, j )
242 c( i, j ) = c( i, j ) + temp*a( i, l )
255 temp = temp + a( l, i )*b( l, j )
257 IF( beta.EQ.zero )
THEN
258 c( i, j ) = alpha*temp
260 c( i, j ) = alpha*temp + beta*c( i, j )
271 IF( beta.EQ.zero )
THEN
275 ELSE IF( beta.NE.one )
THEN
277 c( i, j ) = beta*c( i, j )
281 IF( b( j, l ).NE.zero )
THEN
282 temp = alpha*b( j, l )
284 c( i, j ) = c( i, j ) + temp*a( i, l )
297 temp = temp + a( l, i )*b( j, l )
299 IF( beta.EQ.zero )
THEN
300 c( i, j ) = alpha*temp
302 c( i, j ) = alpha*temp + beta*c( i, j )
subroutine dgemm(TRANSA, TRANSB, M, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
subroutine xerbla(SRNAME, INFO)