00001 SUBROUTINE ZLA_HEAMV( 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, UPLO
00017
00018
00019 COMPLEX*16 A( LDA, * ), X( * )
00020 DOUBLE PRECISION Y( * )
00021
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 DOUBLE PRECISION ONE, ZERO
00122 PARAMETER ( ONE = 1.0D+0, ZERO = 0.0D+0 )
00123
00124
00125 LOGICAL SYMB_ZERO
00126 DOUBLE PRECISION TEMP, SAFE1
00127 INTEGER I, INFO, IY, J, JX, KX, KY
00128 COMPLEX*16 ZDUM
00129
00130
00131 EXTERNAL XERBLA, DLAMCH
00132 DOUBLE PRECISION DLAMCH
00133
00134
00135 EXTERNAL ILAUPLO
00136 INTEGER ILAUPLO
00137
00138
00139 INTRINSIC MAX, ABS, SIGN, REAL, DIMAG
00140
00141
00142 DOUBLE PRECISION CABS1
00143
00144
00145 CABS1( ZDUM ) = ABS( DBLE ( ZDUM ) ) + ABS( DIMAG ( ZDUM ) )
00146
00147
00148
00149
00150
00151 INFO = 0
00152 IF ( UPLO.NE.ILAUPLO( 'U' ) .AND.
00153 $ UPLO.NE.ILAUPLO( 'L' ) )THEN
00154 INFO = 1
00155 ELSE IF( N.LT.0 )THEN
00156 INFO = 2
00157 ELSE IF( LDA.LT.MAX( 1, N ) )THEN
00158 INFO = 5
00159 ELSE IF( INCX.EQ.0 )THEN
00160 INFO = 7
00161 ELSE IF( INCY.EQ.0 )THEN
00162 INFO = 10
00163 END IF
00164 IF( INFO.NE.0 )THEN
00165 CALL XERBLA( 'ZHEMV ', INFO )
00166 RETURN
00167 END IF
00168
00169
00170
00171 IF( ( N.EQ.0 ).OR.( ( ALPHA.EQ.ZERO ).AND.( BETA.EQ.ONE ) ) )
00172 $ RETURN
00173
00174
00175
00176 IF( INCX.GT.0 )THEN
00177 KX = 1
00178 ELSE
00179 KX = 1 - ( N - 1 )*INCX
00180 END IF
00181 IF( INCY.GT.0 )THEN
00182 KY = 1
00183 ELSE
00184 KY = 1 - ( N - 1 )*INCY
00185 END IF
00186
00187
00188
00189
00190 SAFE1 = DLAMCH( 'Safe minimum' )
00191 SAFE1 = (N+1)*SAFE1
00192
00193
00194
00195
00196
00197
00198
00199 IY = KY
00200 IF ( INCX.EQ.1 ) THEN
00201 IF ( UPLO .EQ. ILAUPLO( 'U' ) ) THEN
00202 DO I = 1, N
00203 IF ( BETA .EQ. ZERO ) THEN
00204 SYMB_ZERO = .TRUE.
00205 Y( IY ) = 0.0D+0
00206 ELSE IF ( Y( IY ) .EQ. ZERO ) THEN
00207 SYMB_ZERO = .TRUE.
00208 ELSE
00209 SYMB_ZERO = .FALSE.
00210 Y( IY ) = BETA * ABS( Y( IY ) )
00211 END IF
00212 IF ( ALPHA .NE. ZERO ) THEN
00213 DO J = 1, I
00214 TEMP = CABS1( A( J, I ) )
00215 SYMB_ZERO = SYMB_ZERO .AND.
00216 $ ( X( J ) .EQ. ZERO .OR. TEMP .EQ. ZERO )
00217
00218 Y( IY ) = Y( IY ) + ALPHA*CABS1( X( J ) )*TEMP
00219 END DO
00220 DO J = I+1, N
00221 TEMP = CABS1( A( I, J ) )
00222 SYMB_ZERO = SYMB_ZERO .AND.
00223 $ ( X( J ) .EQ. ZERO .OR. TEMP .EQ. ZERO )
00224
00225 Y( IY ) = Y( IY ) + ALPHA*CABS1( X( J ) )*TEMP
00226 END DO
00227 END IF
00228
00229 IF (.NOT.SYMB_ZERO)
00230 $ Y( IY ) = Y( IY ) + SIGN( SAFE1, Y( IY ) )
00231
00232 IY = IY + INCY
00233 END DO
00234 ELSE
00235 DO I = 1, N
00236 IF ( BETA .EQ. ZERO ) THEN
00237 SYMB_ZERO = .TRUE.
00238 Y( IY ) = 0.0D+0
00239 ELSE IF ( Y( IY ) .EQ. ZERO ) THEN
00240 SYMB_ZERO = .TRUE.
00241 ELSE
00242 SYMB_ZERO = .FALSE.
00243 Y( IY ) = BETA * ABS( Y( IY ) )
00244 END IF
00245 IF ( ALPHA .NE. ZERO ) THEN
00246 DO J = 1, I
00247 TEMP = CABS1( A( I, J ) )
00248 SYMB_ZERO = SYMB_ZERO .AND.
00249 $ ( X( J ) .EQ. ZERO .OR. TEMP .EQ. ZERO )
00250
00251 Y( IY ) = Y( IY ) + ALPHA*CABS1( X( J ) )*TEMP
00252 END DO
00253 DO J = I+1, N
00254 TEMP = CABS1( A( J, I ) )
00255 SYMB_ZERO = SYMB_ZERO .AND.
00256 $ ( X( J ) .EQ. ZERO .OR. TEMP .EQ. ZERO )
00257
00258 Y( IY ) = Y( IY ) + ALPHA*CABS1( X( J ) )*TEMP
00259 END DO
00260 END IF
00261
00262 IF (.NOT.SYMB_ZERO)
00263 $ Y( IY ) = Y( IY ) + SIGN( SAFE1, Y( IY ) )
00264
00265 IY = IY + INCY
00266 END DO
00267 END IF
00268 ELSE
00269 IF ( UPLO .EQ. ILAUPLO( 'U' ) ) THEN
00270 DO I = 1, N
00271 IF ( BETA .EQ. ZERO ) THEN
00272 SYMB_ZERO = .TRUE.
00273 Y( IY ) = 0.0D+0
00274 ELSE IF ( Y( IY ) .EQ. ZERO ) THEN
00275 SYMB_ZERO = .TRUE.
00276 ELSE
00277 SYMB_ZERO = .FALSE.
00278 Y( IY ) = BETA * ABS( Y( IY ) )
00279 END IF
00280 JX = KX
00281 IF ( ALPHA .NE. ZERO ) THEN
00282 DO J = 1, I
00283 TEMP = CABS1( A( J, I ) )
00284 SYMB_ZERO = SYMB_ZERO .AND.
00285 $ ( X( J ) .EQ. ZERO .OR. TEMP .EQ. ZERO )
00286
00287 Y( IY ) = Y( IY ) + ALPHA*CABS1( X( JX ) )*TEMP
00288 JX = JX + INCX
00289 END DO
00290 DO J = I+1, N
00291 TEMP = CABS1( A( I, J ) )
00292 SYMB_ZERO = SYMB_ZERO .AND.
00293 $ ( X( J ) .EQ. ZERO .OR. TEMP .EQ. ZERO )
00294
00295 Y( IY ) = Y( IY ) + ALPHA*CABS1( X( JX ) )*TEMP
00296 JX = JX + INCX
00297 END DO
00298 END IF
00299
00300 IF ( .NOT.SYMB_ZERO )
00301 $ Y( IY ) = Y( IY ) + SIGN( SAFE1, Y( IY ) )
00302
00303 IY = IY + INCY
00304 END DO
00305 ELSE
00306 DO I = 1, N
00307 IF ( BETA .EQ. ZERO ) THEN
00308 SYMB_ZERO = .TRUE.
00309 Y( IY ) = 0.0D+0
00310 ELSE IF ( Y( IY ) .EQ. ZERO ) THEN
00311 SYMB_ZERO = .TRUE.
00312 ELSE
00313 SYMB_ZERO = .FALSE.
00314 Y( IY ) = BETA * ABS( Y( IY ) )
00315 END IF
00316 JX = KX
00317 IF ( ALPHA .NE. ZERO ) THEN
00318 DO J = 1, I
00319 TEMP = CABS1( A( I, J ) )
00320 SYMB_ZERO = SYMB_ZERO .AND.
00321 $ ( X( J ) .EQ. ZERO .OR. TEMP .EQ. ZERO )
00322
00323 Y( IY ) = Y( IY ) + ALPHA*CABS1( X( JX ) )*TEMP
00324 JX = JX + INCX
00325 END DO
00326 DO J = I+1, N
00327 TEMP = CABS1( A( J, I ) )
00328 SYMB_ZERO = SYMB_ZERO .AND.
00329 $ ( X( J ) .EQ. ZERO .OR. TEMP .EQ. ZERO )
00330
00331 Y( IY ) = Y( IY ) + ALPHA*CABS1( X( JX ) )*TEMP
00332 JX = JX + INCX
00333 END DO
00334 END IF
00335
00336 IF ( .NOT.SYMB_ZERO )
00337 $ Y( IY ) = Y( IY ) + SIGN( SAFE1, Y( IY ) )
00338
00339 IY = IY + INCY
00340 END DO
00341 END IF
00342
00343 END IF
00344
00345 RETURN
00346
00347
00348
00349 END