172 SUBROUTINE cherk(UPLO,TRANS,N,K,ALPHA,A,LDA,BETA,C,LDC)
184 COMPLEX A(LDA,*),C(LDC,*)
197 INTRINSIC cmplx,conjg,max,real
202 INTEGER I,INFO,J,L,NROWA
207 parameter(one=1.0e+0,zero=0.0e+0)
212 IF (lsame(trans,
'N'))
THEN
217 upper = lsame(uplo,
'U')
220 IF ((.NOT.upper) .AND. (.NOT.lsame(uplo,
'L')))
THEN
222 ELSE IF ((.NOT.lsame(trans,
'N')) .AND.
223 + (.NOT.lsame(trans,
'C')))
THEN
225 ELSE IF (n.LT.0)
THEN
227 ELSE IF (k.LT.0)
THEN
229 ELSE IF (lda.LT.max(1,nrowa))
THEN
231 ELSE IF (ldc.LT.max(1,n))
THEN
235 CALL xerbla(
'CHERK ',info)
241 IF ((n.EQ.0) .OR. (((alpha.EQ.zero).OR.
242 + (k.EQ.0)).AND. (beta.EQ.one)))
RETURN
246 IF (alpha.EQ.zero)
THEN
248 IF (beta.EQ.zero)
THEN
259 c(j,j) = beta*real(c(j,j))
263 IF (beta.EQ.zero)
THEN
271 c(j,j) = beta*real(c(j,j))
283 IF (lsame(trans,
'N'))
THEN
289 IF (beta.EQ.zero)
THEN
293 ELSE IF (beta.NE.one)
THEN
297 c(j,j) = beta*real(c(j,j))
299 c(j,j) = real(c(j,j))
302 IF (a(j,l).NE.cmplx(zero))
THEN
303 temp = alpha*conjg(a(j,l))
305 c(i,j) = c(i,j) + temp*a(i,l)
307 c(j,j) = real(c(j,j)) + real(temp*a(i,l))
313 IF (beta.EQ.zero)
THEN
317 ELSE IF (beta.NE.one)
THEN
318 c(j,j) = beta*real(c(j,j))
323 c(j,j) = real(c(j,j))
326 IF (a(j,l).NE.cmplx(zero))
THEN
327 temp = alpha*conjg(a(j,l))
328 c(j,j) = real(c(j,j)) + real(temp*a(j,l))
330 c(i,j) = c(i,j) + temp*a(i,l)
345 temp = temp + conjg(a(l,i))*a(l,j)
347 IF (beta.EQ.zero)
THEN
350 c(i,j) = alpha*temp + beta*c(i,j)
355 rtemp = rtemp + real(conjg(a(l,j))*a(l,j))
357 IF (beta.EQ.zero)
THEN
360 c(j,j) = alpha*rtemp + beta*real(c(j,j))
367 rtemp = rtemp + real(conjg(a(l,j))*a(l,j))
369 IF (beta.EQ.zero)
THEN
372 c(j,j) = alpha*rtemp + beta*real(c(j,j))
377 temp = temp + conjg(a(l,i))*a(l,j)
379 IF (beta.EQ.zero)
THEN
382 c(i,j) = alpha*temp + beta*c(i,j)
subroutine xerbla(srname, info)
subroutine cherk(uplo, trans, n, k, alpha, a, lda, beta, c, ldc)
CHERK