1 SUBROUTINE datrmv( UPLO, TRANS, DIAG, N, ALPHA, A, LDA, X, INCX,
10 CHARACTER*1 DIAG, TRANS, UPLO
11 INTEGER INCX, INCY, LDA, N
12 DOUBLE PRECISION ALPHA, BETA
15 DOUBLE PRECISION A( LDA, * ), X( * ), Y( * )
115 DOUBLE PRECISION ONE, ZERO
116 parameter( one = 1.0d+0, zero = 0.0d+0 )
119 INTEGER I, INFO, IX, IY, J, JX, JY, KX, KY
121 DOUBLE PRECISION ABSX, TALPHA, TEMP
138 IF ( .NOT.lsame( uplo ,
'U' ).AND.
139 $ .NOT.lsame( uplo ,
'L' ) )
THEN
141 ELSE IF( .NOT.lsame( trans,
'N' ).AND.
142 $ .NOT.lsame( trans,
'T' ).AND.
143 $ .NOT.lsame( trans,
'C' ) )
THEN
145 ELSE IF( .NOT.lsame( diag ,
'U' ).AND.
146 $ .NOT.lsame( diag ,
'N' ) )
THEN
148 ELSE IF( n.LT.0 )
THEN
150 ELSE IF( lda.LT.
max( 1, n ) )
THEN
152 ELSE IF( incx.EQ.0 )
THEN
154 ELSE IF( incy.EQ.0 )
THEN
158 CALL xerbla(
'DATRMV', info )
165 $ ( ( alpha.EQ.zero ).AND.( beta.EQ.one ) ) )
168 nounit = lsame( diag ,
'N' )
175 kx = 1 - ( n - 1 ) * incx
180 ky = 1 - ( n - 1 ) * incy
189 IF( beta.EQ.zero )
THEN
193 ELSE IF( beta.EQ.one )
THEN
195 y( i ) = abs( y( i ) )
199 y( i ) = abs( beta * y( i ) )
204 IF( beta.EQ.zero )
THEN
209 ELSE IF( beta.EQ.one )
THEN
211 y( iy ) = abs( y( iy ) )
216 y( iy ) = abs( beta * y( iy ) )
225 talpha = abs( alpha )
227 IF( lsame( trans,
'N' ) )
THEN
231 IF( lsame( uplo,
'U' ) )
THEN
235 absx = abs( x( jx ) )
236 IF( absx.NE.zero )
THEN
239 y( i ) = y( i ) + temp * abs( a( i, j ) )
243 y( j ) = y( j ) + temp * abs( a( j, j ) )
245 y( j ) = y( j ) + temp
254 absx = abs( x( jx ) )
255 IF( absx.NE.zero )
THEN
259 y( iy ) = y( iy ) + temp * abs( a( i, j ) )
264 y( iy ) = y( iy ) + temp * abs( a( j, j ) )
266 y( iy ) = y( iy ) + temp
279 absx = abs( x( jx ) )
280 IF( absx.NE.zero )
THEN
285 y( j ) = y( j ) + temp * abs( a( j, j ) )
287 y( j ) = y( j ) + temp
291 y( i ) = y( i ) + temp * abs( a( i, j ) )
300 absx = abs( x( jx ) )
301 IF( absx.NE.zero )
THEN
303 iy = ky + ( j - 1 ) * incy
306 y( iy ) = y( iy ) + temp * abs( a( j, j ) )
308 y( iy ) = y( iy ) + temp
313 y( iy ) = y( iy ) + temp * abs( a( i, j ) )
327 IF( lsame( uplo,
'U' ) )
THEN
335 temp = temp + abs( a( i, j ) * x( i ) )
339 temp = temp + abs( a( j, j ) * x( j ) )
341 temp = temp + abs( x( j ) )
344 y( jy ) = y( jy ) + talpha * temp
355 temp = temp + abs( a( i, j ) * x( ix ) )
360 temp = temp + abs( a( j, j ) * x( ix ) )
362 temp = temp + abs( x( ix ) )
365 y( jy ) = y( jy ) + talpha * temp
380 temp = abs( a( j, j ) * x( j ) )
386 temp = temp + abs( a( i, j ) * x( i ) )
389 y( jy ) = y( jy ) + talpha * temp
398 ix = kx + ( j - 1 ) * incx
401 temp = abs( a( j, j ) * x( ix ) )
403 temp = abs( x( ix ) )
408 temp = temp + abs( a( i, j ) * x( ix ) )
410 y( jy ) = y( jy ) + talpha * temp