197 SUBROUTINE zher2k(UPLO,TRANS,N,K,ALPHA,A,LDA,B,LDB,BETA,C,LDC)
205 DOUBLE PRECISION BETA
206 INTEGER K,LDA,LDB,LDC,N
210 COMPLEX*16 A(LDA,*),B(LDB,*),C(LDC,*)
223 INTRINSIC dble,dconjg,max
226 COMPLEX*16 TEMP1,TEMP2
227 INTEGER I,INFO,J,L,NROWA
232 parameter(one=1.0d+0)
234 parameter(zero= (0.0d+0,0.0d+0))
239 IF (lsame(trans,
'N'))
THEN
244 upper = lsame(uplo,
'U')
247 IF ((.NOT.upper) .AND. (.NOT.lsame(uplo,
'L')))
THEN
249 ELSE IF ((.NOT.lsame(trans,
'N')) .AND.
250 + (.NOT.lsame(trans,
'C')))
THEN
252 ELSE IF (n.LT.0)
THEN
254 ELSE IF (k.LT.0)
THEN
256 ELSE IF (lda.LT.max(1,nrowa))
THEN
258 ELSE IF (ldb.LT.max(1,nrowa))
THEN
260 ELSE IF (ldc.LT.max(1,n))
THEN
264 CALL xerbla(
'ZHER2K',info)
270 IF ((n.EQ.0) .OR. (((alpha.EQ.zero).OR.
271 + (k.EQ.0)).AND. (beta.EQ.one)))
RETURN
275 IF (alpha.EQ.zero)
THEN
277 IF (beta.EQ.dble(zero))
THEN
288 c(j,j) = beta*dble(c(j,j))
292 IF (beta.EQ.dble(zero))
THEN
300 c(j,j) = beta*dble(c(j,j))
312 IF (lsame(trans,
'N'))
THEN
319 IF (beta.EQ.dble(zero))
THEN
323 ELSE IF (beta.NE.one)
THEN
327 c(j,j) = beta*dble(c(j,j))
329 c(j,j) = dble(c(j,j))
332 IF ((a(j,l).NE.zero) .OR. (b(j,l).NE.zero))
THEN
333 temp1 = alpha*dconjg(b(j,l))
334 temp2 = dconjg(alpha*a(j,l))
336 c(i,j) = c(i,j) + a(i,l)*temp1 +
339 c(j,j) = dble(c(j,j)) +
340 + dble(a(j,l)*temp1+b(j,l)*temp2)
346 IF (beta.EQ.dble(zero))
THEN
350 ELSE IF (beta.NE.one)
THEN
354 c(j,j) = beta*dble(c(j,j))
356 c(j,j) = dble(c(j,j))
359 IF ((a(j,l).NE.zero) .OR. (b(j,l).NE.zero))
THEN
360 temp1 = alpha*dconjg(b(j,l))
361 temp2 = dconjg(alpha*a(j,l))
363 c(i,j) = c(i,j) + a(i,l)*temp1 +
366 c(j,j) = dble(c(j,j)) +
367 + dble(a(j,l)*temp1+b(j,l)*temp2)
383 temp1 = temp1 + dconjg(a(l,i))*b(l,j)
384 temp2 = temp2 + dconjg(b(l,i))*a(l,j)
387 IF (beta.EQ.dble(zero))
THEN
388 c(j,j) = dble(alpha*temp1+
389 + dconjg(alpha)*temp2)
391 c(j,j) = beta*dble(c(j,j)) +
393 + dconjg(alpha)*temp2)
396 IF (beta.EQ.dble(zero))
THEN
397 c(i,j) = alpha*temp1 + dconjg(alpha)*temp2
399 c(i,j) = beta*c(i,j) + alpha*temp1 +
400 + dconjg(alpha)*temp2
411 temp1 = temp1 + dconjg(a(l,i))*b(l,j)
412 temp2 = temp2 + dconjg(b(l,i))*a(l,j)
415 IF (beta.EQ.dble(zero))
THEN
416 c(j,j) = dble(alpha*temp1+
417 + dconjg(alpha)*temp2)
419 c(j,j) = beta*dble(c(j,j)) +
421 + dconjg(alpha)*temp2)
424 IF (beta.EQ.dble(zero))
THEN
425 c(i,j) = alpha*temp1 + dconjg(alpha)*temp2
427 c(i,j) = beta*c(i,j) + alpha*temp1 +
428 + dconjg(alpha)*temp2
subroutine xerbla(srname, info)
subroutine zher2k(uplo, trans, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
ZHER2K