151 SUBROUTINE cher2(UPLO,N,ALPHA,X,INCX,Y,INCY,A,LDA)
160 INTEGER INCX,INCY,LDA,N
164 COMPLEX A(lda,*),X(*),Y(*)
171 parameter(zero= (0.0e+0,0.0e+0))
175 INTEGER I,INFO,IX,IY,J,JX,JY,KX,KY
185 INTRINSIC conjg,max,real
191 IF (.NOT.lsame(uplo,
'U') .AND. .NOT.lsame(uplo,
'L'))
THEN
193 ELSE IF (n.LT.0)
THEN
195 ELSE IF (incx.EQ.0)
THEN
197 ELSE IF (incy.EQ.0)
THEN
199 ELSE IF (lda.LT.max(1,n))
THEN
203 CALL xerbla(
'CHER2 ',info)
209 IF ((n.EQ.0) .OR. (alpha.EQ.zero))
RETURN
214 IF ((incx.NE.1) .OR. (incy.NE.1))
THEN
233 IF (lsame(uplo,
'U'))
THEN
237 IF ((incx.EQ.1) .AND. (incy.EQ.1))
THEN
239 IF ((x(j).NE.zero) .OR. (y(j).NE.zero))
THEN
240 temp1 = alpha*conjg(y(j))
241 temp2 = conjg(alpha*x(j))
243 a(i,j) = a(i,j) + x(i)*temp1 + y(i)*temp2
245 a(j,j) =
REAL(A(J,J)) +
246 +
REAL(x(j)*temp1+y(j)*temp2)
248 a(j,j) =
REAL(a(j,j))
253 IF ((x(jx).NE.zero) .OR. (y(jy).NE.zero))
THEN
254 temp1 = alpha*conjg(y(jy))
255 temp2 = conjg(alpha*x(jx))
259 a(i,j) = a(i,j) + x(ix)*temp1 + y(iy)*temp2
263 a(j,j) =
REAL(A(J,J)) +
264 +
REAL(x(jx)*temp1+y(jy)*temp2)
266 a(j,j) =
REAL(a(j,j))
276 IF ((incx.EQ.1) .AND. (incy.EQ.1))
THEN
278 IF ((x(j).NE.zero) .OR. (y(j).NE.zero))
THEN
279 temp1 = alpha*conjg(y(j))
280 temp2 = conjg(alpha*x(j))
281 a(j,j) =
REAL(A(J,J)) +
282 +
REAL(x(j)*temp1+y(j)*temp2)
284 a(i,j) = a(i,j) + x(i)*temp1 + y(i)*temp2
287 a(j,j) =
REAL(a(j,j))
292 IF ((x(jx).NE.zero) .OR. (y(jy).NE.zero))
THEN
293 temp1 = alpha*conjg(y(jy))
294 temp2 = conjg(alpha*x(jx))
295 a(j,j) =
REAL(A(J,J)) +
296 +
REAL(x(jx)*temp1+y(jy)*temp2)
302 a(i,j) = a(i,j) + x(ix)*temp1 + y(iy)*temp2
305 a(j,j) =
REAL(a(j,j))
subroutine xerbla(SRNAME, INFO)
XERBLA
subroutine cher2(UPLO, N, ALPHA, X, INCX, Y, INCY, A, LDA)
CHER2