198 SUBROUTINE cher2k(UPLO,TRANS,N,K,ALPHA,A,LDA,B,LDB,BETA,C,LDC)
208 INTEGER k,lda,ldb,ldc,n
212 COMPLEX a(lda,*),b(ldb,*),c(ldc,*)
225 INTRINSIC conjg,max,real
229 INTEGER i,info,j,l,nrowa
234 parameter(one=1.0e+0)
236 parameter(zero= (0.0e+0,0.0e+0))
241 IF (
lsame(trans,
'N'))
THEN
246 upper =
lsame(uplo,
'U')
249 IF ((.NOT.upper) .AND. (.NOT.
lsame(uplo,
'L')))
THEN
251 ELSE IF ((.NOT.
lsame(trans,
'N')) .AND.
252 + (.NOT.
lsame(trans,
'C')))
THEN
254 ELSE IF (n.LT.0)
THEN
256 ELSE IF (k.LT.0)
THEN
258 ELSE IF (lda.LT.max(1,nrowa))
THEN
260 ELSE IF (ldb.LT.max(1,nrowa))
THEN
262 ELSE IF (ldc.LT.max(1,n))
THEN
266 CALL
xerbla(
'CHER2K',info)
272 IF ((n.EQ.0) .OR. (((alpha.EQ.zero).OR.
273 + (k.EQ.0)).AND. (beta.EQ.one))) return
277 IF (alpha.EQ.zero)
THEN
279 IF (beta.EQ.
REAL(zero)) then
290 c(j,j) = beta*
REAL(c(j,j))
294 IF (beta.EQ.
REAL(zero)) then
302 c(j,j) = beta*
REAL(c(j,j))
314 IF (
lsame(trans,
'N'))
THEN
321 IF (beta.EQ.
REAL(zero)) then
325 ELSE IF (beta.NE.one)
THEN
329 c(j,j) = beta*
REAL(c(j,j))
331 c(j,j) =
REAL(c(j,j))
334 IF ((a(j,l).NE.zero) .OR. (b(j,l).NE.zero))
THEN
335 temp1 = alpha*conjg(b(j,l))
336 temp2 = conjg(alpha*a(j,l))
338 c(i,j) = c(i,j) + a(i,l)*temp1 +
341 c(j,j) =
REAL(C(J,J)) +
342 +
REAL(a(j,l)*temp1+b(j,l)*temp2)
348 IF (beta.EQ.
REAL(zero)) then
352 ELSE IF (beta.NE.one)
THEN
356 c(j,j) = beta*
REAL(c(j,j))
358 c(j,j) =
REAL(c(j,j))
361 IF ((a(j,l).NE.zero) .OR. (b(j,l).NE.zero))
THEN
362 temp1 = alpha*conjg(b(j,l))
363 temp2 = conjg(alpha*a(j,l))
365 c(i,j) = c(i,j) + a(i,l)*temp1 +
368 c(j,j) =
REAL(C(J,J)) +
369 +
REAL(a(j,l)*temp1+b(j,l)*temp2)
385 temp1 = temp1 + conjg(a(l,i))*b(l,j)
386 temp2 = temp2 + conjg(b(l,i))*a(l,j)
389 IF (beta.EQ.
REAL(zero)) then
390 c(j,j) =
REAL(alpha*temp1+
391 + conjg(alpha)*temp2)
393 c(j,j) = beta*
REAL(C(J,J)) +
395 + conjg(alpha)*temp2)
398 IF (beta.EQ.
REAL(zero)) then
399 c(i,j) = alpha*temp1 + conjg(alpha)*temp2
401 c(i,j) = beta*c(i,j) + alpha*temp1 +
413 temp1 = temp1 + conjg(a(l,i))*b(l,j)
414 temp2 = temp2 + conjg(b(l,i))*a(l,j)
417 IF (beta.EQ.
REAL(zero)) then
418 c(j,j) =
REAL(alpha*temp1+
419 + conjg(alpha)*temp2)
421 c(j,j) = beta*
REAL(C(J,J)) +
423 + conjg(alpha)*temp2)
426 IF (beta.EQ.
REAL(zero)) then
427 c(i,j) = alpha*temp1 + conjg(alpha)*temp2
429 c(i,j) = beta*c(i,j) + alpha*temp1 +