00001 SUBROUTINE ZLA_SYAMV( UPLO, N, ALPHA, A, LDA, X, INCX, BETA, Y,
00002 $ INCY )
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 IMPLICIT NONE
00013
00014
00015 DOUBLE PRECISION ALPHA, BETA
00016 INTEGER INCX, INCY, LDA, N
00017 INTEGER UPLO
00018
00019
00020 COMPLEX*16 A( LDA, * ), X( * )
00021 DOUBLE PRECISION Y( * )
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122 DOUBLE PRECISION ONE, ZERO
00123 PARAMETER ( ONE = 1.0D+0, ZERO = 0.0D+0 )
00124
00125
00126 LOGICAL SYMB_ZERO
00127 DOUBLE PRECISION TEMP, SAFE1
00128 INTEGER I, INFO, IY, J, JX, KX, KY
00129 COMPLEX*16 ZDUM
00130
00131
00132 EXTERNAL XERBLA, DLAMCH
00133 DOUBLE PRECISION DLAMCH
00134
00135
00136 EXTERNAL ILAUPLO
00137 INTEGER ILAUPLO
00138
00139
00140 INTRINSIC MAX, ABS, SIGN, REAL, DIMAG
00141
00142
00143 DOUBLE PRECISION CABS1
00144
00145
00146 CABS1( ZDUM ) = ABS( DBLE ( ZDUM ) ) + ABS( DIMAG ( ZDUM ) )
00147
00148
00149
00150
00151
00152 INFO = 0
00153 IF ( UPLO.NE.ILAUPLO( 'U' ) .AND.
00154 $ UPLO.NE.ILAUPLO( 'L' ) )THEN
00155 INFO = 1
00156 ELSE IF( N.LT.0 )THEN
00157 INFO = 2
00158 ELSE IF( LDA.LT.MAX( 1, N ) )THEN
00159 INFO = 5
00160 ELSE IF( INCX.EQ.0 )THEN
00161 INFO = 7
00162 ELSE IF( INCY.EQ.0 )THEN
00163 INFO = 10
00164 END IF
00165 IF( INFO.NE.0 )THEN
00166 CALL XERBLA( 'DSYMV ', INFO )
00167 RETURN
00168 END IF
00169
00170
00171
00172 IF( ( N.EQ.0 ).OR.( ( ALPHA.EQ.ZERO ).AND.( BETA.EQ.ONE ) ) )
00173 $ RETURN
00174
00175
00176
00177 IF( INCX.GT.0 )THEN
00178 KX = 1
00179 ELSE
00180 KX = 1 - ( N - 1 )*INCX
00181 END IF
00182 IF( INCY.GT.0 )THEN
00183 KY = 1
00184 ELSE
00185 KY = 1 - ( N - 1 )*INCY
00186 END IF
00187
00188
00189
00190
00191 SAFE1 = DLAMCH( 'Safe minimum' )
00192 SAFE1 = (N+1)*SAFE1
00193
00194
00195
00196
00197
00198
00199
00200 IY = KY
00201 IF ( INCX.EQ.1 ) THEN
00202 IF ( UPLO .EQ. ILAUPLO( 'U' ) ) THEN
00203 DO I = 1, N
00204 IF ( BETA .EQ. ZERO ) THEN
00205 SYMB_ZERO = .TRUE.
00206 Y( IY ) = 0.0D+0
00207 ELSE IF ( Y( IY ) .EQ. ZERO ) THEN
00208 SYMB_ZERO = .TRUE.
00209 ELSE
00210 SYMB_ZERO = .FALSE.
00211 Y( IY ) = BETA * ABS( Y( IY ) )
00212 END IF
00213 IF ( ALPHA .NE. ZERO ) THEN
00214 DO J = 1, I
00215 TEMP = CABS1( A( J, I ) )
00216 SYMB_ZERO = SYMB_ZERO .AND.
00217 $ ( X( J ) .EQ. ZERO .OR. TEMP .EQ. ZERO )
00218
00219 Y( IY ) = Y( IY ) + ALPHA*CABS1( X( J ) )*TEMP
00220 END DO
00221 DO J = I+1, N
00222 TEMP = CABS1( A( I, J ) )
00223 SYMB_ZERO = SYMB_ZERO .AND.
00224 $ ( X( J ) .EQ. ZERO .OR. TEMP .EQ. ZERO )
00225
00226 Y( IY ) = Y( IY ) + ALPHA*CABS1( X( J ) )*TEMP
00227 END DO
00228 END IF
00229
00230 IF ( .NOT.SYMB_ZERO )
00231 $ Y( IY ) = Y( IY ) + SIGN( SAFE1, Y( IY ) )
00232
00233 IY = IY + INCY
00234 END DO
00235 ELSE
00236 DO I = 1, N
00237 IF ( BETA .EQ. ZERO ) THEN
00238 SYMB_ZERO = .TRUE.
00239 Y( IY ) = 0.0D+0
00240 ELSE IF ( Y( IY ) .EQ. ZERO ) THEN
00241 SYMB_ZERO = .TRUE.
00242 ELSE
00243 SYMB_ZERO = .FALSE.
00244 Y( IY ) = BETA * ABS( Y( IY ) )
00245 END IF
00246 IF ( ALPHA .NE. ZERO ) THEN
00247 DO J = 1, I
00248 TEMP = CABS1( A( I, J ) )
00249 SYMB_ZERO = SYMB_ZERO .AND.
00250 $ ( X( J ) .EQ. ZERO .OR. TEMP .EQ. ZERO )
00251
00252 Y( IY ) = Y( IY ) + ALPHA*CABS1( X( J ) )*TEMP
00253 END DO
00254 DO J = I+1, N
00255 TEMP = CABS1( A( J, I ) )
00256 SYMB_ZERO = SYMB_ZERO .AND.
00257 $ ( X( J ) .EQ. ZERO .OR. TEMP .EQ. ZERO )
00258
00259 Y( IY ) = Y( IY ) + ALPHA*CABS1( X( J ) )*TEMP
00260 END DO
00261 END IF
00262
00263 IF ( .NOT.SYMB_ZERO )
00264 $ Y( IY ) = Y( IY ) + SIGN( SAFE1, Y( IY ) )
00265
00266 IY = IY + INCY
00267 END DO
00268 END IF
00269 ELSE
00270 IF ( UPLO .EQ. ILAUPLO( 'U' ) ) THEN
00271 DO I = 1, N
00272 IF ( BETA .EQ. ZERO ) THEN
00273 SYMB_ZERO = .TRUE.
00274 Y( IY ) = 0.0D+0
00275 ELSE IF ( Y( IY ) .EQ. ZERO ) THEN
00276 SYMB_ZERO = .TRUE.
00277 ELSE
00278 SYMB_ZERO = .FALSE.
00279 Y( IY ) = BETA * ABS( Y( IY ) )
00280 END IF
00281 JX = KX
00282 IF ( ALPHA .NE. ZERO ) THEN
00283 DO J = 1, I
00284 TEMP = CABS1( A( J, I ) )
00285 SYMB_ZERO = SYMB_ZERO .AND.
00286 $ ( X( J ) .EQ. ZERO .OR. TEMP .EQ. ZERO )
00287
00288 Y( IY ) = Y( IY ) + ALPHA*CABS1( X( JX ) )*TEMP
00289 JX = JX + INCX
00290 END DO
00291 DO J = I+1, N
00292 TEMP = CABS1( A( I, J ) )
00293 SYMB_ZERO = SYMB_ZERO .AND.
00294 $ ( X( J ) .EQ. ZERO .OR. TEMP .EQ. ZERO )
00295
00296 Y( IY ) = Y( IY ) + ALPHA*CABS1( X( JX ) )*TEMP
00297 JX = JX + INCX
00298 END DO
00299 END IF
00300
00301 IF ( .NOT.SYMB_ZERO )
00302 $ Y( IY ) = Y( IY ) + SIGN( SAFE1, Y( IY ) )
00303
00304 IY = IY + INCY
00305 END DO
00306 ELSE
00307 DO I = 1, N
00308 IF ( BETA .EQ. ZERO ) THEN
00309 SYMB_ZERO = .TRUE.
00310 Y( IY ) = 0.0D+0
00311 ELSE IF ( Y( IY ) .EQ. ZERO ) THEN
00312 SYMB_ZERO = .TRUE.
00313 ELSE
00314 SYMB_ZERO = .FALSE.
00315 Y( IY ) = BETA * ABS( Y( IY ) )
00316 END IF
00317 JX = KX
00318 IF ( ALPHA .NE. ZERO ) THEN
00319 DO J = 1, I
00320 TEMP = CABS1( A( I, J ) )
00321 SYMB_ZERO = SYMB_ZERO .AND.
00322 $ ( X( J ) .EQ. ZERO .OR. TEMP .EQ. ZERO )
00323
00324 Y( IY ) = Y( IY ) + ALPHA*CABS1( X( JX ) )*TEMP
00325 JX = JX + INCX
00326 END DO
00327 DO J = I+1, N
00328 TEMP = CABS1( A( J, I ) )
00329 SYMB_ZERO = SYMB_ZERO .AND.
00330 $ ( X( J ) .EQ. ZERO .OR. TEMP .EQ. ZERO )
00331
00332 Y( IY ) = Y( IY ) + ALPHA*CABS1( X( JX ) )*TEMP
00333 JX = JX + INCX
00334 END DO
00335 END IF
00336
00337 IF ( .NOT.SYMB_ZERO )
00338 $ Y( IY ) = Y( IY ) + SIGN( SAFE1, Y( IY ) )
00339
00340 IY = IY + INCY
00341 END DO
00342 END IF
00343
00344 END IF
00345
00346 RETURN
00347
00348
00349
00350 END