summaryrefslogtreecommitdiff
path: root/SRC/cla_syamv.f
diff options
context:
space:
mode:
authordeaglanhalligan <deaglanhalligan@8a072113-8704-0410-8d35-dd094bca7971>2009-02-13 23:58:46 +0000
committerdeaglanhalligan <deaglanhalligan@8a072113-8704-0410-8d35-dd094bca7971>2009-02-13 23:58:46 +0000
commit46e09e3c99a1c6aeedcde4281d7625a76f48d315 (patch)
tree942c090e0a2c3b96035d4a7187459c460cb35a5d /SRC/cla_syamv.f
parent165a76fe3b8aaf2e928c1a2ebdf0d9444d98a22f (diff)
downloadlapack-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/cla_syamv.f')
-rw-r--r--SRC/cla_syamv.f203
1 files changed, 133 insertions, 70 deletions
diff --git a/SRC/cla_syamv.f b/SRC/cla_syamv.f
index 00faa2dd..f366060a 100644
--- a/SRC/cla_syamv.f
+++ b/SRC/cla_syamv.f
@@ -199,85 +199,148 @@
*
IY = KY
IF ( INCX.EQ.1 ) THEN
- DO I = 1, N
- 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, N
- IF ( UPLO .EQ. ILAUPLO( 'U' ) ) THEN
- IF ( I .LE. J ) THEN
- TEMP = CABS1( A( I, J ) )
- ELSE
- TEMP = CABS1( A( J, I ) )
- END IF
- ELSE
- IF ( I .GE. J ) THEN
- TEMP = CABS1( A( I, J ) )
- ELSE
- TEMP = CABS1( A( J, I ) )
- END IF
- END IF
+ IF ( UPLO .EQ. ILAUPLO( 'U' ) ) THEN
+ DO I = 1, N
+ 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, I
+ TEMP = CABS1( A( J, I ) )
+ SYMB_ZERO = SYMB_ZERO .AND.
+ $ ( X( J ) .EQ. ZERO .OR. TEMP .EQ. ZERO )
- SYMB_ZERO = SYMB_ZERO .AND.
- $ ( X( J ) .EQ. ZERO .OR. TEMP .EQ. ZERO )
+ Y( IY ) = Y( IY ) + ALPHA*CABS1( X( J ) )*TEMP
+ END DO
+ DO J = I+1, N
+ TEMP = CABS1( A( I, J ) )
+ SYMB_ZERO = SYMB_ZERO .AND.
+ $ ( X( J ) .EQ. ZERO .OR. TEMP .EQ. ZERO )
- Y( IY ) = Y( IY ) + ALPHA*CABS1( X( J ) )*TEMP
- END DO
- END IF
+ Y( IY ) = Y( IY ) + ALPHA*CABS1( X( J ) )*TEMP
+ 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
+ IY = IY + INCY
+ END DO
+ ELSE
+ DO I = 1, N
+ 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, I
+ TEMP = CABS1( A( I, J ) )
+ SYMB_ZERO = SYMB_ZERO .AND.
+ $ ( X( J ) .EQ. ZERO .OR. TEMP .EQ. ZERO )
+
+ Y( IY ) = Y( IY ) + ALPHA*CABS1( X( J ) )*TEMP
+ END DO
+ DO J = I+1, N
+ TEMP = CABS1( A( J, I ) )
+ SYMB_ZERO = SYMB_ZERO .AND.
+ $ ( X( J ) .EQ. ZERO .OR. TEMP .EQ. ZERO )
+
+ Y( IY ) = Y( IY ) + ALPHA*CABS1( X( J ) )*TEMP
+ END DO
+ END IF
+
+ IF ( .NOT.SYMB_ZERO )
+ $ Y( IY ) = Y( IY ) + SIGN( SAFE1, Y( IY ) )
+
+ IY = IY + INCY
+ END DO
+ END IF
ELSE
- DO I = 1, N
- 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
- JX = KX
- IF ( ALPHA .NE. ZERO ) THEN
- DO J = 1, N
- IF ( UPLO .EQ. ILAUPLO( 'U' ) ) THEN
- IF ( I .LE. J ) THEN
- TEMP = CABS1( A( I, J ) )
- ELSE
- TEMP = CABS1( A( J, I ) )
- END IF
- ELSE
- IF ( I .GE. J ) THEN
- TEMP = CABS1( A( I, J ) )
- ELSE
- TEMP = CABS1( A( J, I ) )
- END IF
- END IF
+ IF ( UPLO .EQ. ILAUPLO( 'U' ) ) THEN
+ DO I = 1, N
+ 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
+ JX = KX
+ IF ( ALPHA .NE. ZERO ) THEN
+ DO J = 1, I
+ TEMP = CABS1( A( J, I ) )
+ SYMB_ZERO = SYMB_ZERO .AND.
+ $ ( X( J ) .EQ. ZERO .OR. TEMP .EQ. ZERO )
+
+ Y( IY ) = Y( IY ) + ALPHA*CABS1( X( JX ) )*TEMP
+ JX = JX + INCX
+ END DO
+ DO J = I+1, N
+ TEMP = CABS1( A( I, J ) )
+ SYMB_ZERO = SYMB_ZERO .AND.
+ $ ( X( J ) .EQ. ZERO .OR. TEMP .EQ. ZERO )
+
+ Y( IY ) = Y( IY ) + ALPHA*CABS1( 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, N
+ 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
+ JX = KX
+ IF ( ALPHA .NE. ZERO ) THEN
+ DO J = 1, I
+ TEMP = CABS1( A( I, J ) )
+ SYMB_ZERO = SYMB_ZERO .AND.
+ $ ( X( J ) .EQ. ZERO .OR. TEMP .EQ. ZERO )
+
+ Y( IY ) = Y( IY ) + ALPHA*CABS1( X( JX ) )*TEMP
+ JX = JX + INCX
+ END DO
+ DO J = I+1, N
+ TEMP = CABS1( A( J, I ) )
+ SYMB_ZERO = SYMB_ZERO .AND.
+ $ ( X( J ) .EQ. ZERO .OR. TEMP .EQ. ZERO )
- SYMB_ZERO = SYMB_ZERO .AND.
- $ ( X( J ) .EQ. ZERO .OR. TEMP .EQ. ZERO )
+ Y( IY ) = Y( IY ) + ALPHA*CABS1( X( JX ) )*TEMP
+ JX = JX + INCX
+ END DO
+ END IF
- Y( IY ) = Y( IY ) + ALPHA*CABS1( 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