diff options
author | deaglanhalligan <deaglanhalligan@8a072113-8704-0410-8d35-dd094bca7971> | 2009-02-13 23:58:46 +0000 |
---|---|---|
committer | deaglanhalligan <deaglanhalligan@8a072113-8704-0410-8d35-dd094bca7971> | 2009-02-13 23:58:46 +0000 |
commit | 46e09e3c99a1c6aeedcde4281d7625a76f48d315 (patch) | |
tree | 942c090e0a2c3b96035d4a7187459c460cb35a5d /SRC/sla_geamv.f | |
parent | 165a76fe3b8aaf2e928c1a2ebdf0d9444d98a22f (diff) | |
download | lapack-46e09e3c99a1c6aeedcde4281d7625a76f48d315.tar.gz lapack-46e09e3c99a1c6aeedcde4281d7625a76f48d315.tar.bz2 lapack-46e09e3c99a1c6aeedcde4281d7625a76f48d315.zip |
Restructured loops in {c,z}la_yyrcond_{x,c} and {s,c,d,z}la_yyamv to do less comparisons.
Diffstat (limited to 'SRC/sla_geamv.f')
-rw-r--r-- | SRC/sla_geamv.f | 156 |
1 files changed, 102 insertions, 54 deletions
diff --git a/SRC/sla_geamv.f b/SRC/sla_geamv.f index c70febe2..cb513c39 100644 --- a/SRC/sla_geamv.f +++ b/SRC/sla_geamv.f @@ -139,8 +139,8 @@ * INFO = 0 IF ( .NOT.( ( TRANS.EQ.ILATRANS( 'N' ) ) - $ .OR. ( TRANS.EQ.ILATRANS( 'T' ) ) - $ .OR. ( TRANS.EQ.ILATRANS( 'C' ) ) ) ) THEN + $ .OR. ( TRANS.EQ.ILATRANS( 'T' ) ) + $ .OR. ( TRANS.EQ.ILATRANS( 'C' )) ) ) THEN INFO = 1 ELSE IF( M.LT.0 )THEN INFO = 2 @@ -199,70 +199,118 @@ * IY = KY IF ( INCX.EQ.1 ) THEN - DO I = 1, LENY - IF ( BETA .EQ. ZERO ) THEN - SYMB_ZERO = .TRUE. - Y( IY ) = 0.0 - ELSE IF ( Y( IY ) .EQ. ZERO ) THEN - SYMB_ZERO = .TRUE. - ELSE - SYMB_ZERO = .FALSE. - Y( IY ) = BETA * ABS( Y( IY ) ) - END IF - IF ( ALPHA .NE. ZERO ) THEN - DO J = 1, LENX - IF( TRANS.EQ.ILATRANS( 'N' ) )THEN + IF( TRANS.EQ.ILATRANS( 'N' ) )THEN + DO I = 1, LENY + IF ( BETA .EQ. ZERO ) THEN + SYMB_ZERO = .TRUE. + Y( IY ) = 0.0 + ELSE IF ( Y( IY ) .EQ. ZERO ) THEN + SYMB_ZERO = .TRUE. + ELSE + SYMB_ZERO = .FALSE. + Y( IY ) = BETA * ABS( Y( IY ) ) + END IF + IF ( ALPHA .NE. ZERO ) THEN + DO J = 1, LENX TEMP = ABS( A( I, J ) ) - ELSE - TEMP = ABS( A( J, I ) ) - END IF + SYMB_ZERO = SYMB_ZERO .AND. + $ ( X( J ) .EQ. ZERO .OR. TEMP .EQ. ZERO ) + + Y( IY ) = Y( IY ) + ALPHA*ABS( X( J ) )*TEMP + END DO + END IF - SYMB_ZERO = SYMB_ZERO .AND. - $ ( X( J ) .EQ. ZERO .OR. TEMP .EQ. ZERO ) + IF ( .NOT.SYMB_ZERO ) + $ Y( IY ) = Y( IY ) + SIGN( SAFE1, Y( IY ) ) - Y( IY ) = Y( IY ) + ALPHA*ABS( X( J ) )*TEMP - END DO - END IF + IY = IY + INCY + END DO + ELSE + DO I = 1, LENY + IF ( BETA .EQ. ZERO ) THEN + SYMB_ZERO = .TRUE. + Y( IY ) = 0.0 + ELSE IF ( Y( IY ) .EQ. ZERO ) THEN + SYMB_ZERO = .TRUE. + ELSE + SYMB_ZERO = .FALSE. + Y( IY ) = BETA * ABS( Y( IY ) ) + END IF + IF ( ALPHA .NE. ZERO ) THEN + DO J = 1, LENX + TEMP = ABS( A( J, I ) ) + SYMB_ZERO = SYMB_ZERO .AND. + $ ( X( J ) .EQ. ZERO .OR. TEMP .EQ. ZERO ) - IF ( .NOT.SYMB_ZERO ) - $ Y( IY ) = Y( IY ) + SIGN( SAFE1, Y( IY ) ) + Y( IY ) = Y( IY ) + ALPHA*ABS( X( J ) )*TEMP + END DO + END IF - IY = IY + INCY - END DO - ELSE - DO I = 1, LENY - IF ( BETA .EQ. ZERO ) THEN - SYMB_ZERO = .TRUE. - Y( IY ) = 0.0 - ELSE IF ( Y( IY ) .EQ. ZERO ) THEN - SYMB_ZERO = .TRUE. - ELSE - SYMB_ZERO = .FALSE. - Y( IY ) = BETA * ABS( Y( IY ) ) - END IF - IF ( ALPHA .NE. ZERO ) THEN - JX = KX - DO J = 1, LENX + IF ( .NOT.SYMB_ZERO ) + $ Y( IY ) = Y( IY ) + SIGN( SAFE1, Y( IY ) ) - IF( TRANS.EQ.ILATRANS( 'N' ) )THEN + IY = IY + INCY + END DO + END IF + ELSE + IF( TRANS.EQ.ILATRANS( 'N' ) )THEN + DO I = 1, LENY + IF ( BETA .EQ. ZERO ) THEN + SYMB_ZERO = .TRUE. + Y( IY ) = 0.0 + ELSE IF ( Y( IY ) .EQ. ZERO ) THEN + SYMB_ZERO = .TRUE. + ELSE + SYMB_ZERO = .FALSE. + Y( IY ) = BETA * ABS( Y( IY ) ) + END IF + IF ( ALPHA .NE. ZERO ) THEN + JX = KX + DO J = 1, LENX TEMP = ABS( A( I, J ) ) - ELSE + SYMB_ZERO = SYMB_ZERO .AND. + $ ( X( JX ) .EQ. ZERO .OR. TEMP .EQ. ZERO ) + + Y( IY ) = Y( IY ) + ALPHA*ABS( X( JX ) )*TEMP + JX = JX + INCX + END DO + END IF + + IF (.NOT.SYMB_ZERO) + $ Y( IY ) = Y( IY ) + SIGN( SAFE1, Y( IY ) ) + + IY = IY + INCY + END DO + ELSE + DO I = 1, LENY + IF ( BETA .EQ. ZERO ) THEN + SYMB_ZERO = .TRUE. + Y( IY ) = 0.0 + ELSE IF ( Y( IY ) .EQ. ZERO ) THEN + SYMB_ZERO = .TRUE. + ELSE + SYMB_ZERO = .FALSE. + Y( IY ) = BETA * ABS( Y( IY ) ) + END IF + IF ( ALPHA .NE. ZERO ) THEN + JX = KX + DO J = 1, LENX TEMP = ABS( A( J, I ) ) - END IF + SYMB_ZERO = SYMB_ZERO .AND. + $ ( X( JX ) .EQ. ZERO .OR. TEMP .EQ. ZERO ) - SYMB_ZERO = SYMB_ZERO .AND. - $ ( X( JX ) .EQ. ZERO .OR. TEMP .EQ. ZERO ) + Y( IY ) = Y( IY ) + ALPHA*ABS( X( JX ) )*TEMP + JX = JX + INCX + END DO + END IF - Y( IY ) = Y( IY ) + ALPHA*ABS( X( JX ) )*TEMP - JX = JX + INCX - END DO - END IF + IF (.NOT.SYMB_ZERO) + $ Y( IY ) = Y( IY ) + SIGN( SAFE1, Y( IY ) ) - IF (.NOT.SYMB_ZERO) - $ Y( IY ) = Y( IY ) + SIGN( SAFE1, Y( IY ) ) + IY = IY + INCY + END DO + END IF - IY = IY + INCY - END DO END IF * RETURN |