173 SUBROUTINE cla_geamv( TRANS, M, N, ALPHA, A, LDA, X, INCX,
183 INTEGER INCX, INCY, LDA, M, N
187 COMPLEX A( LDA, * ), X( * )
195 PARAMETER ( ONE = 1.0e+0, zero = 0.0e+0 )
200 INTEGER I, INFO, IY, J, JX, KX, KY, LENX, LENY
212 INTRINSIC max, abs, real, aimag, sign
218 cabs1( cdum ) = abs( real( cdum ) ) + abs( aimag( cdum ) )
225 IF ( .NOT.( ( trans.EQ.ilatrans(
'N' ) )
226 $ .OR. ( trans.EQ.ilatrans(
'T' ) )
227 $ .OR. ( trans.EQ.ilatrans(
'C' ) ) ) )
THEN
229 ELSE IF( m.LT.0 )
THEN
231 ELSE IF( n.LT.0 )
THEN
233 ELSE IF( lda.LT.max( 1, m ) )
THEN
235 ELSE IF( incx.EQ.0 )
THEN
237 ELSE IF( incy.EQ.0 )
THEN
241 CALL xerbla(
'CLA_GEAMV ', info )
247 IF( ( m.EQ.0 ).OR.( n.EQ.0 ).OR.
248 $ ( ( alpha.EQ.zero ).AND.( beta.EQ.one ) ) )
254 IF( trans.EQ.ilatrans(
'N' ) )
THEN
264 kx = 1 - ( lenx - 1 )*incx
269 ky = 1 - ( leny - 1 )*incy
275 safe1 = slamch(
'Safe minimum' )
285 IF ( incx.EQ.1 )
THEN
286 IF( trans.EQ.ilatrans(
'N' ) )
THEN
288 IF ( beta .EQ. 0.0 )
THEN
291 ELSE IF ( y( iy ) .EQ. 0.0 )
THEN
295 y( iy ) = beta * abs( y( iy ) )
297 IF ( alpha .NE. 0.0 )
THEN
299 temp = cabs1( a( i, j ) )
300 symb_zero = symb_zero .AND.
301 $ ( x( j ) .EQ. zero .OR. temp .EQ. zero )
303 y( iy ) = y( iy ) + alpha*cabs1( x( j ) )*temp
307 IF ( .NOT.symb_zero ) y( iy ) =
308 $ y( iy ) + sign( safe1, y( iy ) )
314 IF ( beta .EQ. 0.0 )
THEN
317 ELSE IF ( y( iy ) .EQ. 0.0 )
THEN
321 y( iy ) = beta * abs( y( iy ) )
323 IF ( alpha .NE. 0.0 )
THEN
325 temp = cabs1( a( j, i ) )
326 symb_zero = symb_zero .AND.
327 $ ( x( j ) .EQ. zero .OR. temp .EQ. zero )
329 y( iy ) = y( iy ) + alpha*cabs1( x( j ) )*temp
333 IF ( .NOT.symb_zero ) y( iy ) =
334 $ y( iy ) + sign( safe1, y( iy ) )
340 IF( trans.EQ.ilatrans(
'N' ) )
THEN
342 IF ( beta .EQ. 0.0 )
THEN
345 ELSE IF ( y( iy ) .EQ. 0.0 )
THEN
349 y( iy ) = beta * abs( y( iy ) )
351 IF ( alpha .NE. 0.0 )
THEN
354 temp = cabs1( a( i, j ) )
355 symb_zero = symb_zero .AND.
356 $ ( x( jx ) .EQ. zero .OR. temp .EQ. zero )
358 y( iy ) = y( iy ) + alpha*cabs1( x( jx ) )*temp
363 IF ( .NOT.symb_zero ) y( iy ) =
364 $ y( iy ) + sign( safe1, y( iy ) )
370 IF ( beta .EQ. 0.0 )
THEN
373 ELSE IF ( y( iy ) .EQ. 0.0 )
THEN
377 y( iy ) = beta * abs( y( iy ) )
379 IF ( alpha .NE. 0.0 )
THEN
382 temp = cabs1( a( j, i ) )
383 symb_zero = symb_zero .AND.
384 $ ( x( jx ) .EQ. zero .OR. temp .EQ. zero )
386 y( iy ) = y( iy ) + alpha*cabs1( x( jx ) )*temp
391 IF ( .NOT.symb_zero ) y( iy ) =
392 $ y( iy ) + sign( safe1, y( iy ) )
subroutine cla_geamv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
CLA_GEAMV computes a matrix-vector product using a general matrix to calculate error bounds.