196 SUBROUTINE cher2k(UPLO,TRANS,N,K,ALPHA,A,LDA,B,LDB,BETA,C,LDC)
205 INTEGER K,LDA,LDB,LDC,N
209 COMPLEX A(LDA,*),B(LDB,*),C(LDC,*)
222 INTRINSIC conjg,max,real
226 INTEGER I,INFO,J,L,NROWA
231 parameter(one=1.0e+0)
233 parameter(zero= (0.0e+0,0.0e+0))
238 IF (lsame(trans,
'N'))
THEN
243 upper = lsame(uplo,
'U')
246 IF ((.NOT.upper) .AND. (.NOT.lsame(uplo,
'L')))
THEN
248 ELSE IF ((.NOT.lsame(trans,
'N')) .AND.
249 + (.NOT.lsame(trans,
'C')))
THEN
251 ELSE IF (n.LT.0)
THEN
253 ELSE IF (k.LT.0)
THEN
255 ELSE IF (lda.LT.max(1,nrowa))
THEN
257 ELSE IF (ldb.LT.max(1,nrowa))
THEN
259 ELSE IF (ldc.LT.max(1,n))
THEN
263 CALL xerbla(
'CHER2K',info)
269 IF ((n.EQ.0) .OR. (((alpha.EQ.zero).OR.
270 + (k.EQ.0)).AND. (beta.EQ.one)))
RETURN
274 IF (alpha.EQ.zero)
THEN
276 IF (beta.EQ.real(zero))
THEN
287 c(j,j) = beta*real(c(j,j))
291 IF (beta.EQ.real(zero))
THEN
299 c(j,j) = beta*real(c(j,j))
311 IF (lsame(trans,
'N'))
THEN
318 IF (beta.EQ.real(zero))
THEN
322 ELSE IF (beta.NE.one)
THEN
326 c(j,j) = beta*real(c(j,j))
328 c(j,j) = real(c(j,j))
331 IF ((a(j,l).NE.zero) .OR. (b(j,l).NE.zero))
THEN
332 temp1 = alpha*conjg(b(j,l))
333 temp2 = conjg(alpha*a(j,l))
335 c(i,j) = c(i,j) + a(i,l)*temp1 +
338 c(j,j) = real(c(j,j)) +
339 + real(a(j,l)*temp1+b(j,l)*temp2)
345 IF (beta.EQ.real(zero))
THEN
349 ELSE IF (beta.NE.one)
THEN
353 c(j,j) = beta*real(c(j,j))
355 c(j,j) = real(c(j,j))
358 IF ((a(j,l).NE.zero) .OR. (b(j,l).NE.zero))
THEN
359 temp1 = alpha*conjg(b(j,l))
360 temp2 = conjg(alpha*a(j,l))
362 c(i,j) = c(i,j) + a(i,l)*temp1 +
365 c(j,j) = real(c(j,j)) +
366 + real(a(j,l)*temp1+b(j,l)*temp2)
382 temp1 = temp1 + conjg(a(l,i))*b(l,j)
383 temp2 = temp2 + conjg(b(l,i))*a(l,j)
386 IF (beta.EQ.real(zero))
THEN
387 c(j,j) = real(alpha*temp1+
388 + conjg(alpha)*temp2)
390 c(j,j) = beta*real(c(j,j)) +
392 + conjg(alpha)*temp2)
395 IF (beta.EQ.real(zero))
THEN
396 c(i,j) = alpha*temp1 + conjg(alpha)*temp2
398 c(i,j) = beta*c(i,j) + alpha*temp1 +
410 temp1 = temp1 + conjg(a(l,i))*b(l,j)
411 temp2 = temp2 + conjg(b(l,i))*a(l,j)
414 IF (beta.EQ.real(zero))
THEN
415 c(j,j) = real(alpha*temp1+
416 + conjg(alpha)*temp2)
418 c(j,j) = beta*real(c(j,j)) +
420 + conjg(alpha)*temp2)
423 IF (beta.EQ.real(zero))
THEN
424 c(i,j) = alpha*temp1 + conjg(alpha)*temp2
426 c(i,j) = beta*c(i,j) + alpha*temp1 +
subroutine xerbla(srname, info)
subroutine cher2k(uplo, trans, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
CHER2K