199 SUBROUTINE zher2k(UPLO,TRANS,N,K,ALPHA,A,LDA,B,LDB,BETA,C,LDC)
208 DOUBLE PRECISION BETA
209 INTEGER K,LDA,LDB,LDC,N
213 COMPLEX*16 A(lda,*),B(ldb,*),C(ldc,*)
226 INTRINSIC dble,dconjg,max
229 COMPLEX*16 TEMP1,TEMP2
230 INTEGER I,INFO,J,L,NROWA
235 parameter(one=1.0d+0)
237 parameter(zero= (0.0d+0,0.0d+0))
242 IF (lsame(trans,
'N'))
THEN
247 upper = lsame(uplo,
'U')
250 IF ((.NOT.upper) .AND. (.NOT.lsame(uplo,
'L')))
THEN
252 ELSE IF ((.NOT.lsame(trans,
'N')) .AND.
253 + (.NOT.lsame(trans,
'C')))
THEN
255 ELSE IF (n.LT.0)
THEN
257 ELSE IF (k.LT.0)
THEN
259 ELSE IF (lda.LT.max(1,nrowa))
THEN
261 ELSE IF (ldb.LT.max(1,nrowa))
THEN
263 ELSE IF (ldc.LT.max(1,n))
THEN
267 CALL xerbla(
'ZHER2K',info)
273 IF ((n.EQ.0) .OR. (((alpha.EQ.zero).OR.
274 + (k.EQ.0)).AND. (beta.EQ.one)))
RETURN
278 IF (alpha.EQ.zero)
THEN
280 IF (beta.EQ.dble(zero))
THEN
291 c(j,j) = beta*dble(c(j,j))
295 IF (beta.EQ.dble(zero))
THEN
303 c(j,j) = beta*dble(c(j,j))
315 IF (lsame(trans,
'N'))
THEN
322 IF (beta.EQ.dble(zero))
THEN
326 ELSE IF (beta.NE.one)
THEN
330 c(j,j) = beta*dble(c(j,j))
332 c(j,j) = dble(c(j,j))
335 IF ((a(j,l).NE.zero) .OR. (b(j,l).NE.zero))
THEN
336 temp1 = alpha*dconjg(b(j,l))
337 temp2 = dconjg(alpha*a(j,l))
339 c(i,j) = c(i,j) + a(i,l)*temp1 +
342 c(j,j) = dble(c(j,j)) +
343 + dble(a(j,l)*temp1+b(j,l)*temp2)
349 IF (beta.EQ.dble(zero))
THEN
353 ELSE IF (beta.NE.one)
THEN
357 c(j,j) = beta*dble(c(j,j))
359 c(j,j) = dble(c(j,j))
362 IF ((a(j,l).NE.zero) .OR. (b(j,l).NE.zero))
THEN
363 temp1 = alpha*dconjg(b(j,l))
364 temp2 = dconjg(alpha*a(j,l))
366 c(i,j) = c(i,j) + a(i,l)*temp1 +
369 c(j,j) = dble(c(j,j)) +
370 + dble(a(j,l)*temp1+b(j,l)*temp2)
386 temp1 = temp1 + dconjg(a(l,i))*b(l,j)
387 temp2 = temp2 + dconjg(b(l,i))*a(l,j)
390 IF (beta.EQ.dble(zero))
THEN
391 c(j,j) = dble(alpha*temp1+
392 + dconjg(alpha)*temp2)
394 c(j,j) = beta*dble(c(j,j)) +
396 + dconjg(alpha)*temp2)
399 IF (beta.EQ.dble(zero))
THEN
400 c(i,j) = alpha*temp1 + dconjg(alpha)*temp2
402 c(i,j) = beta*c(i,j) + alpha*temp1 +
403 + dconjg(alpha)*temp2
414 temp1 = temp1 + dconjg(a(l,i))*b(l,j)
415 temp2 = temp2 + dconjg(b(l,i))*a(l,j)
418 IF (beta.EQ.dble(zero))
THEN
419 c(j,j) = dble(alpha*temp1+
420 + dconjg(alpha)*temp2)
422 c(j,j) = beta*dble(c(j,j)) +
424 + dconjg(alpha)*temp2)
427 IF (beta.EQ.dble(zero))
THEN
428 c(i,j) = alpha*temp1 + dconjg(alpha)*temp2
430 c(i,j) = beta*c(i,j) + alpha*temp1 +
431 + dconjg(alpha)*temp2
subroutine xerbla(SRNAME, INFO)
XERBLA
subroutine zher2k(UPLO, TRANS, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
ZHER2K