164 SUBROUTINE zhfrk( TRANSR, UPLO, TRANS, N, K, ALPHA, A, LDA,
173 DOUBLE PRECISION ALPHA, BETA
175 CHARACTER TRANS, TRANSR, UPLO
178 COMPLEX*16 A( LDA, * ), C( * )
184 DOUBLE PRECISION ONE, ZERO
186 parameter( one = 1.0d+0, zero = 0.0d+0 )
187 parameter( czero = ( 0.0d+0, 0.0d+0 ) )
190 LOGICAL LOWER, NORMALTRANSR, NISODD, NOTRANS
191 INTEGER INFO, NROWA, J, NK, N1, N2
192 COMPLEX*16 CALPHA, CBETA
202 INTRINSIC max, dcmplx
210 normaltransr = lsame( transr,
'N' )
211 lower = lsame( uplo,
'L' )
212 notrans = lsame( trans,
'N' )
220 IF( .NOT.normaltransr .AND. .NOT.lsame( transr,
'C' ) )
THEN
222 ELSE IF( .NOT.lower .AND. .NOT.lsame( uplo,
'U' ) )
THEN
224 ELSE IF( .NOT.notrans .AND. .NOT.lsame( trans,
'C' ) )
THEN
226 ELSE IF( n.LT.0 )
THEN
228 ELSE IF( k.LT.0 )
THEN
230 ELSE IF( lda.LT.max( 1, nrowa ) )
THEN
234 CALL xerbla(
'ZHFRK ', -info )
243 IF( ( n.EQ.0 ) .OR. ( ( ( alpha.EQ.zero ) .OR. ( k.EQ.0 ) ) .AND.
244 $ ( beta.EQ.one ) ) )
RETURN
246 IF( ( alpha.EQ.zero ) .AND. ( beta.EQ.zero ) )
THEN
247 DO j = 1, ( ( n*( n+1 ) ) / 2 )
253 calpha = dcmplx( alpha, zero )
254 cbeta = dcmplx( beta, zero )
260 IF( mod( n, 2 ).EQ.0 )
THEN
278 IF( normaltransr )
THEN
290 CALL zherk(
'L',
'N', n1, k, alpha, a( 1, 1 ), lda,
292 CALL zherk(
'U',
'N', n2, k, alpha, a( n1+1, 1 ),
294 $ beta, c( n+1 ), n )
295 CALL zgemm(
'N',
'C', n2, n1, k, calpha, a( n1+1,
297 $ lda, a( 1, 1 ), lda, cbeta, c( n1+1 ), n )
303 CALL zherk(
'L',
'C', n1, k, alpha, a( 1, 1 ), lda,
305 CALL zherk(
'U',
'C', n2, k, alpha, a( 1, n1+1 ),
307 $ beta, c( n+1 ), n )
308 CALL zgemm(
'C',
'N', n2, n1, k, calpha, a( 1,
310 $ lda, a( 1, 1 ), lda, cbeta, c( n1+1 ), n )
322 CALL zherk(
'L',
'N', n1, k, alpha, a( 1, 1 ), lda,
323 $ beta, c( n2+1 ), n )
324 CALL zherk(
'U',
'N', n2, k, alpha, a( n2, 1 ),
326 $ beta, c( n1+1 ), n )
327 CALL zgemm(
'N',
'C', n1, n2, k, calpha, a( 1, 1 ),
328 $ lda, a( n2, 1 ), lda, cbeta, c( 1 ), n )
334 CALL zherk(
'L',
'C', n1, k, alpha, a( 1, 1 ), lda,
335 $ beta, c( n2+1 ), n )
336 CALL zherk(
'U',
'C', n2, k, alpha, a( 1, n2 ),
338 $ beta, c( n1+1 ), n )
339 CALL zgemm(
'C',
'N', n1, n2, k, calpha, a( 1, 1 ),
340 $ lda, a( 1, n2 ), lda, cbeta, c( 1 ), n )
358 CALL zherk(
'U',
'N', n1, k, alpha, a( 1, 1 ), lda,
360 CALL zherk(
'L',
'N', n2, k, alpha, a( n1+1, 1 ),
363 CALL zgemm(
'N',
'C', n1, n2, k, calpha, a( 1, 1 ),
364 $ lda, a( n1+1, 1 ), lda, cbeta,
371 CALL zherk(
'U',
'C', n1, k, alpha, a( 1, 1 ), lda,
373 CALL zherk(
'L',
'C', n2, k, alpha, a( 1, n1+1 ),
376 CALL zgemm(
'C',
'N', n1, n2, k, calpha, a( 1, 1 ),
377 $ lda, a( 1, n1+1 ), lda, cbeta,
390 CALL zherk(
'U',
'N', n1, k, alpha, a( 1, 1 ), lda,
391 $ beta, c( n2*n2+1 ), n2 )
392 CALL zherk(
'L',
'N', n2, k, alpha, a( n1+1, 1 ),
394 $ beta, c( n1*n2+1 ), n2 )
395 CALL zgemm(
'N',
'C', n2, n1, k, calpha, a( n1+1,
397 $ lda, a( 1, 1 ), lda, cbeta, c( 1 ), n2 )
403 CALL zherk(
'U',
'C', n1, k, alpha, a( 1, 1 ), lda,
404 $ beta, c( n2*n2+1 ), n2 )
405 CALL zherk(
'L',
'C', n2, k, alpha, a( 1, n1+1 ),
407 $ beta, c( n1*n2+1 ), n2 )
408 CALL zgemm(
'C',
'N', n2, n1, k, calpha, a( 1,
410 $ lda, a( 1, 1 ), lda, cbeta, c( 1 ), n2 )
422 IF( normaltransr )
THEN
434 CALL zherk(
'L',
'N', nk, k, alpha, a( 1, 1 ), lda,
435 $ beta, c( 2 ), n+1 )
436 CALL zherk(
'U',
'N', nk, k, alpha, a( nk+1, 1 ),
438 $ beta, c( 1 ), n+1 )
439 CALL zgemm(
'N',
'C', nk, nk, k, calpha, a( nk+1,
441 $ lda, a( 1, 1 ), lda, cbeta, c( nk+2 ),
448 CALL zherk(
'L',
'C', nk, k, alpha, a( 1, 1 ), lda,
449 $ beta, c( 2 ), n+1 )
450 CALL zherk(
'U',
'C', nk, k, alpha, a( 1, nk+1 ),
452 $ beta, c( 1 ), n+1 )
453 CALL zgemm(
'C',
'N', nk, nk, k, calpha, a( 1,
455 $ lda, a( 1, 1 ), lda, cbeta, c( nk+2 ),
468 CALL zherk(
'L',
'N', nk, k, alpha, a( 1, 1 ), lda,
469 $ beta, c( nk+2 ), n+1 )
470 CALL zherk(
'U',
'N', nk, k, alpha, a( nk+1, 1 ),
472 $ beta, c( nk+1 ), n+1 )
473 CALL zgemm(
'N',
'C', nk, nk, k, calpha, a( 1, 1 ),
474 $ lda, a( nk+1, 1 ), lda, cbeta, c( 1 ),
481 CALL zherk(
'L',
'C', nk, k, alpha, a( 1, 1 ), lda,
482 $ beta, c( nk+2 ), n+1 )
483 CALL zherk(
'U',
'C', nk, k, alpha, a( 1, nk+1 ),
485 $ beta, c( nk+1 ), n+1 )
486 CALL zgemm(
'C',
'N', nk, nk, k, calpha, a( 1, 1 ),
487 $ lda, a( 1, nk+1 ), lda, cbeta, c( 1 ),
506 CALL zherk(
'U',
'N', nk, k, alpha, a( 1, 1 ), lda,
507 $ beta, c( nk+1 ), nk )
508 CALL zherk(
'L',
'N', nk, k, alpha, a( nk+1, 1 ),
511 CALL zgemm(
'N',
'C', nk, nk, k, calpha, a( 1, 1 ),
512 $ lda, a( nk+1, 1 ), lda, cbeta,
513 $ c( ( ( nk+1 )*nk )+1 ), nk )
519 CALL zherk(
'U',
'C', nk, k, alpha, a( 1, 1 ), lda,
520 $ beta, c( nk+1 ), nk )
521 CALL zherk(
'L',
'C', nk, k, alpha, a( 1, nk+1 ),
524 CALL zgemm(
'C',
'N', nk, nk, k, calpha, a( 1, 1 ),
525 $ lda, a( 1, nk+1 ), lda, cbeta,
526 $ c( ( ( nk+1 )*nk )+1 ), nk )
538 CALL zherk(
'U',
'N', nk, k, alpha, a( 1, 1 ), lda,
539 $ beta, c( nk*( nk+1 )+1 ), nk )
540 CALL zherk(
'L',
'N', nk, k, alpha, a( nk+1, 1 ),
542 $ beta, c( nk*nk+1 ), nk )
543 CALL zgemm(
'N',
'C', nk, nk, k, calpha, a( nk+1,
545 $ lda, a( 1, 1 ), lda, cbeta, c( 1 ), nk )
551 CALL zherk(
'U',
'C', nk, k, alpha, a( 1, 1 ), lda,
552 $ beta, c( nk*( nk+1 )+1 ), nk )
553 CALL zherk(
'L',
'C', nk, k, alpha, a( 1, nk+1 ),
555 $ beta, c( nk*nk+1 ), nk )
556 CALL zgemm(
'C',
'N', nk, nk, k, calpha, a( 1,
558 $ lda, a( 1, 1 ), lda, cbeta, c( 1 ), nk )