166 SUBROUTINE zhfrk( TRANSR, UPLO, TRANS, N, K, ALPHA, A, LDA, BETA,
174 DOUBLE PRECISION ALPHA, BETA
176 CHARACTER TRANS, TRANSR, UPLO
179 COMPLEX*16 A( LDA, * ), C( * )
185 DOUBLE PRECISION ONE, ZERO
187 parameter( one = 1.0d+0, zero = 0.0d+0 )
188 parameter( czero = ( 0.0d+0, 0.0d+0 ) )
191 LOGICAL LOWER, NORMALTRANSR, NISODD, NOTRANS
192 INTEGER INFO, NROWA, J, NK, N1, N2
193 COMPLEX*16 CALPHA, CBETA
203 INTRINSIC max, dcmplx
211 normaltransr = lsame( transr,
'N' )
212 lower = lsame( uplo,
'L' )
213 notrans = lsame( trans,
'N' )
221 IF( .NOT.normaltransr .AND. .NOT.lsame( transr,
'C' ) )
THEN
223 ELSE IF( .NOT.lower .AND. .NOT.lsame( uplo,
'U' ) )
THEN
225 ELSE IF( .NOT.notrans .AND. .NOT.lsame( trans,
'C' ) )
THEN
227 ELSE IF( n.LT.0 )
THEN
229 ELSE IF( k.LT.0 )
THEN
231 ELSE IF( lda.LT.max( 1, nrowa ) )
THEN
235 CALL xerbla(
'ZHFRK ', -info )
244 IF( ( n.EQ.0 ) .OR. ( ( ( alpha.EQ.zero ) .OR. ( k.EQ.0 ) ) .AND.
245 $ ( beta.EQ.one ) ) )
RETURN
247 IF( ( alpha.EQ.zero ) .AND. ( beta.EQ.zero ) )
THEN
248 DO j = 1, ( ( n*( n+1 ) ) / 2 )
254 calpha = dcmplx( alpha, zero )
255 cbeta = dcmplx( beta, zero )
261 IF( mod( n, 2 ).EQ.0 )
THEN
279 IF( normaltransr )
THEN
291 CALL zherk(
'L',
'N', n1, k, alpha, a( 1, 1 ), lda,
293 CALL zherk(
'U',
'N', n2, k, alpha, a( n1+1, 1 ), lda,
294 $ beta, c( n+1 ), n )
295 CALL zgemm(
'N',
'C', n2, n1, k, calpha, a( n1+1, 1 ),
296 $ lda, a( 1, 1 ), lda, cbeta, c( n1+1 ), n )
302 CALL zherk(
'L',
'C', n1, k, alpha, a( 1, 1 ), lda,
304 CALL zherk(
'U',
'C', n2, k, alpha, a( 1, n1+1 ), lda,
305 $ beta, c( n+1 ), n )
306 CALL zgemm(
'C',
'N', n2, n1, k, calpha, a( 1, n1+1 ),
307 $ lda, a( 1, 1 ), lda, cbeta, c( n1+1 ), n )
319 CALL zherk(
'L',
'N', n1, k, alpha, a( 1, 1 ), lda,
320 $ beta, c( n2+1 ), n )
321 CALL zherk(
'U',
'N', n2, k, alpha, a( n2, 1 ), lda,
322 $ beta, c( n1+1 ), n )
323 CALL zgemm(
'N',
'C', n1, n2, k, calpha, a( 1, 1 ),
324 $ lda, a( n2, 1 ), lda, cbeta, c( 1 ), n )
330 CALL zherk(
'L',
'C', n1, k, alpha, a( 1, 1 ), lda,
331 $ beta, c( n2+1 ), n )
332 CALL zherk(
'U',
'C', n2, k, alpha, a( 1, n2 ), lda,
333 $ beta, c( n1+1 ), n )
334 CALL zgemm(
'C',
'N', n1, n2, k, calpha, a( 1, 1 ),
335 $ lda, a( 1, n2 ), lda, cbeta, c( 1 ), n )
353 CALL zherk(
'U',
'N', n1, k, alpha, a( 1, 1 ), lda,
355 CALL zherk(
'L',
'N', n2, k, alpha, a( n1+1, 1 ), lda,
357 CALL zgemm(
'N',
'C', n1, n2, k, calpha, a( 1, 1 ),
358 $ lda, a( n1+1, 1 ), lda, cbeta,
365 CALL zherk(
'U',
'C', n1, k, alpha, a( 1, 1 ), lda,
367 CALL zherk(
'L',
'C', n2, k, alpha, a( 1, n1+1 ), lda,
369 CALL zgemm(
'C',
'N', n1, n2, k, calpha, a( 1, 1 ),
370 $ lda, a( 1, n1+1 ), lda, cbeta,
383 CALL zherk(
'U',
'N', n1, k, alpha, a( 1, 1 ), lda,
384 $ beta, c( n2*n2+1 ), n2 )
385 CALL zherk(
'L',
'N', n2, k, alpha, a( n1+1, 1 ), lda,
386 $ beta, c( n1*n2+1 ), n2 )
387 CALL zgemm(
'N',
'C', n2, n1, k, calpha, a( n1+1, 1 ),
388 $ lda, a( 1, 1 ), lda, cbeta, c( 1 ), n2 )
394 CALL zherk(
'U',
'C', n1, k, alpha, a( 1, 1 ), lda,
395 $ beta, c( n2*n2+1 ), n2 )
396 CALL zherk(
'L',
'C', n2, k, alpha, a( 1, n1+1 ), lda,
397 $ beta, c( n1*n2+1 ), n2 )
398 CALL zgemm(
'C',
'N', n2, n1, k, calpha, a( 1, n1+1 ),
399 $ lda, a( 1, 1 ), lda, cbeta, c( 1 ), n2 )
411 IF( normaltransr )
THEN
423 CALL zherk(
'L',
'N', nk, k, alpha, a( 1, 1 ), lda,
424 $ beta, c( 2 ), n+1 )
425 CALL zherk(
'U',
'N', nk, k, alpha, a( nk+1, 1 ), lda,
426 $ beta, c( 1 ), n+1 )
427 CALL zgemm(
'N',
'C', nk, nk, k, calpha, a( nk+1, 1 ),
428 $ lda, a( 1, 1 ), lda, cbeta, c( nk+2 ),
435 CALL zherk(
'L',
'C', nk, k, alpha, a( 1, 1 ), lda,
436 $ beta, c( 2 ), n+1 )
437 CALL zherk(
'U',
'C', nk, k, alpha, a( 1, nk+1 ), lda,
438 $ beta, c( 1 ), n+1 )
439 CALL zgemm(
'C',
'N', nk, nk, k, calpha, a( 1, nk+1 ),
440 $ lda, a( 1, 1 ), lda, cbeta, c( nk+2 ),
453 CALL zherk(
'L',
'N', nk, k, alpha, a( 1, 1 ), lda,
454 $ beta, c( nk+2 ), n+1 )
455 CALL zherk(
'U',
'N', nk, k, alpha, a( nk+1, 1 ), lda,
456 $ beta, c( nk+1 ), n+1 )
457 CALL zgemm(
'N',
'C', nk, nk, k, calpha, a( 1, 1 ),
458 $ lda, a( nk+1, 1 ), lda, cbeta, c( 1 ),
465 CALL zherk(
'L',
'C', nk, k, alpha, a( 1, 1 ), lda,
466 $ beta, c( nk+2 ), n+1 )
467 CALL zherk(
'U',
'C', nk, k, alpha, a( 1, nk+1 ), lda,
468 $ beta, c( nk+1 ), n+1 )
469 CALL zgemm(
'C',
'N', nk, nk, k, calpha, a( 1, 1 ),
470 $ lda, a( 1, nk+1 ), lda, cbeta, c( 1 ),
489 CALL zherk(
'U',
'N', nk, k, alpha, a( 1, 1 ), lda,
490 $ beta, c( nk+1 ), nk )
491 CALL zherk(
'L',
'N', nk, k, alpha, a( nk+1, 1 ), lda,
493 CALL zgemm(
'N',
'C', nk, nk, k, calpha, a( 1, 1 ),
494 $ lda, a( nk+1, 1 ), lda, cbeta,
495 $ c( ( ( nk+1 )*nk )+1 ), nk )
501 CALL zherk(
'U',
'C', nk, k, alpha, a( 1, 1 ), lda,
502 $ beta, c( nk+1 ), nk )
503 CALL zherk(
'L',
'C', nk, k, alpha, a( 1, nk+1 ), lda,
505 CALL zgemm(
'C',
'N', nk, nk, k, calpha, a( 1, 1 ),
506 $ lda, a( 1, nk+1 ), lda, cbeta,
507 $ c( ( ( nk+1 )*nk )+1 ), nk )
519 CALL zherk(
'U',
'N', nk, k, alpha, a( 1, 1 ), lda,
520 $ beta, c( nk*( nk+1 )+1 ), nk )
521 CALL zherk(
'L',
'N', nk, k, alpha, a( nk+1, 1 ), lda,
522 $ beta, c( nk*nk+1 ), nk )
523 CALL zgemm(
'N',
'C', nk, nk, k, calpha, a( nk+1, 1 ),
524 $ lda, a( 1, 1 ), lda, cbeta, c( 1 ), nk )
530 CALL zherk(
'U',
'C', nk, k, alpha, a( 1, 1 ), lda,
531 $ beta, c( nk*( nk+1 )+1 ), nk )
532 CALL zherk(
'L',
'C', nk, k, alpha, a( 1, nk+1 ), lda,
533 $ beta, c( nk*nk+1 ), nk )
534 CALL zgemm(
'C',
'N', nk, nk, k, calpha, a( 1, nk+1 ),
535 $ lda, a( 1, 1 ), lda, cbeta, c( 1 ), nk )
subroutine xerbla(srname, info)
subroutine zgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
ZGEMM
subroutine zherk(uplo, trans, n, k, alpha, a, lda, beta, c, ldc)
ZHERK
subroutine zhfrk(transr, uplo, trans, n, k, alpha, a, lda, beta, c)
ZHFRK performs a Hermitian rank-k operation for matrix in RFP format.