Go to the documentation of this file.00001 SUBROUTINE CHPMV(UPLO,N,ALPHA,AP,X,INCX,BETA,Y,INCY)
00002
00003 COMPLEX ALPHA,BETA
00004 INTEGER INCX,INCY,N
00005 CHARACTER UPLO
00006
00007
00008 COMPLEX AP(*),X(*),Y(*)
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
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 COMPLEX ONE
00104 PARAMETER (ONE= (1.0E+0,0.0E+0))
00105 COMPLEX ZERO
00106 PARAMETER (ZERO= (0.0E+0,0.0E+0))
00107
00108
00109 COMPLEX TEMP1,TEMP2
00110 INTEGER I,INFO,IX,IY,J,JX,JY,K,KK,KX,KY
00111
00112
00113 LOGICAL LSAME
00114 EXTERNAL LSAME
00115
00116
00117 EXTERNAL XERBLA
00118
00119
00120 INTRINSIC CONJG,REAL
00121
00122
00123
00124
00125 INFO = 0
00126 IF (.NOT.LSAME(UPLO,'U') .AND. .NOT.LSAME(UPLO,'L')) THEN
00127 INFO = 1
00128 ELSE IF (N.LT.0) THEN
00129 INFO = 2
00130 ELSE IF (INCX.EQ.0) THEN
00131 INFO = 6
00132 ELSE IF (INCY.EQ.0) THEN
00133 INFO = 9
00134 END IF
00135 IF (INFO.NE.0) THEN
00136 CALL XERBLA('CHPMV ',INFO)
00137 RETURN
00138 END IF
00139
00140
00141
00142 IF ((N.EQ.0) .OR. ((ALPHA.EQ.ZERO).AND. (BETA.EQ.ONE))) RETURN
00143
00144
00145
00146 IF (INCX.GT.0) THEN
00147 KX = 1
00148 ELSE
00149 KX = 1 - (N-1)*INCX
00150 END IF
00151 IF (INCY.GT.0) THEN
00152 KY = 1
00153 ELSE
00154 KY = 1 - (N-1)*INCY
00155 END IF
00156
00157
00158
00159
00160
00161
00162 IF (BETA.NE.ONE) THEN
00163 IF (INCY.EQ.1) THEN
00164 IF (BETA.EQ.ZERO) THEN
00165 DO 10 I = 1,N
00166 Y(I) = ZERO
00167 10 CONTINUE
00168 ELSE
00169 DO 20 I = 1,N
00170 Y(I) = BETA*Y(I)
00171 20 CONTINUE
00172 END IF
00173 ELSE
00174 IY = KY
00175 IF (BETA.EQ.ZERO) THEN
00176 DO 30 I = 1,N
00177 Y(IY) = ZERO
00178 IY = IY + INCY
00179 30 CONTINUE
00180 ELSE
00181 DO 40 I = 1,N
00182 Y(IY) = BETA*Y(IY)
00183 IY = IY + INCY
00184 40 CONTINUE
00185 END IF
00186 END IF
00187 END IF
00188 IF (ALPHA.EQ.ZERO) RETURN
00189 KK = 1
00190 IF (LSAME(UPLO,'U')) THEN
00191
00192
00193
00194 IF ((INCX.EQ.1) .AND. (INCY.EQ.1)) THEN
00195 DO 60 J = 1,N
00196 TEMP1 = ALPHA*X(J)
00197 TEMP2 = ZERO
00198 K = KK
00199 DO 50 I = 1,J - 1
00200 Y(I) = Y(I) + TEMP1*AP(K)
00201 TEMP2 = TEMP2 + CONJG(AP(K))*X(I)
00202 K = K + 1
00203 50 CONTINUE
00204 Y(J) = Y(J) + TEMP1*REAL(AP(KK+J-1)) + ALPHA*TEMP2
00205 KK = KK + J
00206 60 CONTINUE
00207 ELSE
00208 JX = KX
00209 JY = KY
00210 DO 80 J = 1,N
00211 TEMP1 = ALPHA*X(JX)
00212 TEMP2 = ZERO
00213 IX = KX
00214 IY = KY
00215 DO 70 K = KK,KK + J - 2
00216 Y(IY) = Y(IY) + TEMP1*AP(K)
00217 TEMP2 = TEMP2 + CONJG(AP(K))*X(IX)
00218 IX = IX + INCX
00219 IY = IY + INCY
00220 70 CONTINUE
00221 Y(JY) = Y(JY) + TEMP1*REAL(AP(KK+J-1)) + ALPHA*TEMP2
00222 JX = JX + INCX
00223 JY = JY + INCY
00224 KK = KK + J
00225 80 CONTINUE
00226 END IF
00227 ELSE
00228
00229
00230
00231 IF ((INCX.EQ.1) .AND. (INCY.EQ.1)) THEN
00232 DO 100 J = 1,N
00233 TEMP1 = ALPHA*X(J)
00234 TEMP2 = ZERO
00235 Y(J) = Y(J) + TEMP1*REAL(AP(KK))
00236 K = KK + 1
00237 DO 90 I = J + 1,N
00238 Y(I) = Y(I) + TEMP1*AP(K)
00239 TEMP2 = TEMP2 + CONJG(AP(K))*X(I)
00240 K = K + 1
00241 90 CONTINUE
00242 Y(J) = Y(J) + ALPHA*TEMP2
00243 KK = KK + (N-J+1)
00244 100 CONTINUE
00245 ELSE
00246 JX = KX
00247 JY = KY
00248 DO 120 J = 1,N
00249 TEMP1 = ALPHA*X(JX)
00250 TEMP2 = ZERO
00251 Y(JY) = Y(JY) + TEMP1*REAL(AP(KK))
00252 IX = JX
00253 IY = JY
00254 DO 110 K = KK + 1,KK + N - J
00255 IX = IX + INCX
00256 IY = IY + INCY
00257 Y(IY) = Y(IY) + TEMP1*AP(K)
00258 TEMP2 = TEMP2 + CONJG(AP(K))*X(IX)
00259 110 CONTINUE
00260 Y(JY) = Y(JY) + ALPHA*TEMP2
00261 JX = JX + INCX
00262 JY = JY + INCY
00263 KK = KK + (N-J+1)
00264 120 CONTINUE
00265 END IF
00266 END IF
00267
00268 RETURN
00269
00270
00271
00272 END