1 SUBROUTINE dsyr2k( UPLO, TRANS, N, K, ALPHA, A, LDA, B, LDB,
4 CHARACTER*1 UPLO, TRANS
5 INTEGER N, K, LDA, LDB, LDC
6 DOUBLE PRECISION ALPHA, BETA
8 DOUBLE PRECISION A( LDA, * ), B( LDB, * ), C( LDC, * )
147 INTEGER I, INFO, J, L, NROWA
148 DOUBLE PRECISION TEMP1, TEMP2
150 DOUBLE PRECISION ONE , ZERO
151 parameter( one = 1.0d+0, zero = 0.0d+0 )
157 IF( lsame( trans,
'N' ) )
THEN
162 upper = lsame( uplo,
'U' )
165 IF( ( .NOT.upper ).AND.
166 $ ( .NOT.lsame( uplo ,
'L' ) ) )
THEN
168 ELSE IF( ( .NOT.lsame( trans,
'N' ) ).AND.
169 $ ( .NOT.lsame( trans,
'T' ) ).AND.
170 $ ( .NOT.lsame( trans,
'C' ) ) )
THEN
172 ELSE IF( n .LT.0 )
THEN
174 ELSE IF( k .LT.0 )
THEN
176 ELSE IF( lda.LT.max( 1, nrowa ) )
THEN
178 ELSE IF( ldb.LT.max( 1, nrowa ) )
THEN
180 ELSE IF( ldc.LT.max( 1, n ) )
THEN
184 CALL xerbla(
'DSYR2K', info )
191 $ ( ( ( alpha.EQ.zero ).OR.( k.EQ.0 ) ).AND.( beta.EQ.one ) ) )
196 IF( alpha.EQ.zero )
THEN
198 IF( beta.EQ.zero )
THEN
207 c( i, j ) = beta*c( i, j )
212 IF( beta.EQ.zero )
THEN
221 c( i, j ) = beta*c( i, j )
231 IF( lsame( trans,
'N' ) )
THEN
237 IF( beta.EQ.zero )
THEN
241 ELSE IF( beta.NE.one )
THEN
243 c( i, j ) = beta*c( i, j )
247 IF( ( a( j, l ).NE.zero ).OR.
248 $ ( b( j, l ).NE.zero ) )
THEN
249 temp1 = alpha*b( j, l )
250 temp2 = alpha*a( j, l )
252 c( i, j ) = c( i, j ) +
253 $ a( i, l )*temp1 + b( i, l )*temp2
260 IF( beta.EQ.zero )
THEN
264 ELSE IF( beta.NE.one )
THEN
266 c( i, j ) = beta*c( i, j )
270 IF( ( a( j, l ).NE.zero ).OR.
271 $ ( b( j, l ).NE.zero ) )
THEN
272 temp1 = alpha*b( j, l )
273 temp2 = alpha*a( j, l )
275 c( i, j ) = c( i, j ) +
276 $ a( i, l )*temp1 + b( i, l )*temp2
292 temp1 = temp1 + a( l, i )*b( l, j )
293 temp2 = temp2 + b( l, i )*a( l, j )
295 IF( beta.EQ.zero )
THEN
296 c( i, j ) = alpha*temp1 + alpha*temp2
298 c( i, j ) = beta *c( i, j ) +
299 $ alpha*temp1 + alpha*temp2
309 temp1 = temp1 + a( l, i )*b( l, j )
310 temp2 = temp2 + b( l, i )*a( l, j )
312 IF( beta.EQ.zero )
THEN
313 c( i, j ) = alpha*temp1 + alpha*temp2
315 c( i, j ) = beta *c( i, j ) +
316 $ alpha*temp1 + alpha*temp2
subroutine dsyr2k(UPLO, TRANS, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
subroutine xerbla(SRNAME, INFO)