166 SUBROUTINE chfrk( TRANSR, UPLO, TRANS, N, K, ALPHA, A, LDA, BETA,
176 CHARACTER TRANS, TRANSR, UPLO
179 COMPLEX A( LDA, * ), C( * )
188 parameter( one = 1.0e+0, zero = 0.0e+0 )
189 parameter( czero = ( 0.0e+0, 0.0e+0 ) )
192 LOGICAL LOWER, NORMALTRANSR, NISODD, NOTRANS
193 INTEGER INFO, NROWA, J, NK, N1, N2
194 COMPLEX CALPHA, CBETA
212 normaltransr = lsame( transr,
'N' )
213 lower = lsame( uplo,
'L' )
214 notrans = lsame( trans,
'N' )
222 IF( .NOT.normaltransr .AND. .NOT.lsame( transr,
'C' ) )
THEN
224 ELSE IF( .NOT.lower .AND. .NOT.lsame( uplo,
'U' ) )
THEN
226 ELSE IF( .NOT.notrans .AND. .NOT.lsame( trans,
'C' ) )
THEN
228 ELSE IF( n.LT.0 )
THEN
230 ELSE IF( k.LT.0 )
THEN
232 ELSE IF( lda.LT.max( 1, nrowa ) )
THEN
236 CALL xerbla(
'CHFRK ', -info )
245 IF( ( n.EQ.0 ) .OR. ( ( ( alpha.EQ.zero ) .OR. ( k.EQ.0 ) ) .AND.
246 $ ( beta.EQ.one ) ) )
RETURN
248 IF( ( alpha.EQ.zero ) .AND. ( beta.EQ.zero ) )
THEN
249 DO j = 1, ( ( n*( n+1 ) ) / 2 )
255 calpha = cmplx( alpha, zero )
256 cbeta = cmplx( beta, zero )
262 IF( mod( n, 2 ).EQ.0 )
THEN
280 IF( normaltransr )
THEN
292 CALL cherk(
'L',
'N', n1, k, alpha, a( 1, 1 ), lda,
294 CALL cherk(
'U',
'N', n2, k, alpha, a( n1+1, 1 ), lda,
295 $ beta, c( n+1 ), n )
296 CALL cgemm(
'N',
'C', n2, n1, k, calpha, a( n1+1, 1 ),
297 $ lda, a( 1, 1 ), lda, cbeta, c( n1+1 ), n )
303 CALL cherk(
'L',
'C', n1, k, alpha, a( 1, 1 ), lda,
305 CALL cherk(
'U',
'C', n2, k, alpha, a( 1, n1+1 ), lda,
306 $ beta, c( n+1 ), n )
307 CALL cgemm(
'C',
'N', n2, n1, k, calpha, a( 1, n1+1 ),
308 $ lda, a( 1, 1 ), lda, cbeta, c( n1+1 ), n )
320 CALL cherk(
'L',
'N', n1, k, alpha, a( 1, 1 ), lda,
321 $ beta, c( n2+1 ), n )
322 CALL cherk(
'U',
'N', n2, k, alpha, a( n2, 1 ), lda,
323 $ beta, c( n1+1 ), n )
324 CALL cgemm(
'N',
'C', n1, n2, k, calpha, a( 1, 1 ),
325 $ lda, a( n2, 1 ), lda, cbeta, c( 1 ), n )
331 CALL cherk(
'L',
'C', n1, k, alpha, a( 1, 1 ), lda,
332 $ beta, c( n2+1 ), n )
333 CALL cherk(
'U',
'C', n2, k, alpha, a( 1, n2 ), lda,
334 $ beta, c( n1+1 ), n )
335 CALL cgemm(
'C',
'N', n1, n2, k, calpha, a( 1, 1 ),
336 $ lda, a( 1, n2 ), lda, cbeta, c( 1 ), n )
354 CALL cherk(
'U',
'N', n1, k, alpha, a( 1, 1 ), lda,
356 CALL cherk(
'L',
'N', n2, k, alpha, a( n1+1, 1 ), lda,
358 CALL cgemm(
'N',
'C', n1, n2, k, calpha, a( 1, 1 ),
359 $ lda, a( n1+1, 1 ), lda, cbeta,
366 CALL cherk(
'U',
'C', n1, k, alpha, a( 1, 1 ), lda,
368 CALL cherk(
'L',
'C', n2, k, alpha, a( 1, n1+1 ), lda,
370 CALL cgemm(
'C',
'N', n1, n2, k, calpha, a( 1, 1 ),
371 $ lda, a( 1, n1+1 ), lda, cbeta,
384 CALL cherk(
'U',
'N', n1, k, alpha, a( 1, 1 ), lda,
385 $ beta, c( n2*n2+1 ), n2 )
386 CALL cherk(
'L',
'N', n2, k, alpha, a( n1+1, 1 ), lda,
387 $ beta, c( n1*n2+1 ), n2 )
388 CALL cgemm(
'N',
'C', n2, n1, k, calpha, a( n1+1, 1 ),
389 $ lda, a( 1, 1 ), lda, cbeta, c( 1 ), n2 )
395 CALL cherk(
'U',
'C', n1, k, alpha, a( 1, 1 ), lda,
396 $ beta, c( n2*n2+1 ), n2 )
397 CALL cherk(
'L',
'C', n2, k, alpha, a( 1, n1+1 ), lda,
398 $ beta, c( n1*n2+1 ), n2 )
399 CALL cgemm(
'C',
'N', n2, n1, k, calpha, a( 1, n1+1 ),
400 $ lda, a( 1, 1 ), lda, cbeta, c( 1 ), n2 )
412 IF( normaltransr )
THEN
424 CALL cherk(
'L',
'N', nk, k, alpha, a( 1, 1 ), lda,
425 $ beta, c( 2 ), n+1 )
426 CALL cherk(
'U',
'N', nk, k, alpha, a( nk+1, 1 ), lda,
427 $ beta, c( 1 ), n+1 )
428 CALL cgemm(
'N',
'C', nk, nk, k, calpha, a( nk+1, 1 ),
429 $ lda, a( 1, 1 ), lda, cbeta, c( nk+2 ),
436 CALL cherk(
'L',
'C', nk, k, alpha, a( 1, 1 ), lda,
437 $ beta, c( 2 ), n+1 )
438 CALL cherk(
'U',
'C', nk, k, alpha, a( 1, nk+1 ), lda,
439 $ beta, c( 1 ), n+1 )
440 CALL cgemm(
'C',
'N', nk, nk, k, calpha, a( 1, nk+1 ),
441 $ lda, a( 1, 1 ), lda, cbeta, c( nk+2 ),
454 CALL cherk(
'L',
'N', nk, k, alpha, a( 1, 1 ), lda,
455 $ beta, c( nk+2 ), n+1 )
456 CALL cherk(
'U',
'N', nk, k, alpha, a( nk+1, 1 ), lda,
457 $ beta, c( nk+1 ), n+1 )
458 CALL cgemm(
'N',
'C', nk, nk, k, calpha, a( 1, 1 ),
459 $ lda, a( nk+1, 1 ), lda, cbeta, c( 1 ),
466 CALL cherk(
'L',
'C', nk, k, alpha, a( 1, 1 ), lda,
467 $ beta, c( nk+2 ), n+1 )
468 CALL cherk(
'U',
'C', nk, k, alpha, a( 1, nk+1 ), lda,
469 $ beta, c( nk+1 ), n+1 )
470 CALL cgemm(
'C',
'N', nk, nk, k, calpha, a( 1, 1 ),
471 $ lda, a( 1, nk+1 ), lda, cbeta, c( 1 ),
490 CALL cherk(
'U',
'N', nk, k, alpha, a( 1, 1 ), lda,
491 $ beta, c( nk+1 ), nk )
492 CALL cherk(
'L',
'N', nk, k, alpha, a( nk+1, 1 ), lda,
494 CALL cgemm(
'N',
'C', nk, nk, k, calpha, a( 1, 1 ),
495 $ lda, a( nk+1, 1 ), lda, cbeta,
496 $ c( ( ( nk+1 )*nk )+1 ), nk )
502 CALL cherk(
'U',
'C', nk, k, alpha, a( 1, 1 ), lda,
503 $ beta, c( nk+1 ), nk )
504 CALL cherk(
'L',
'C', nk, k, alpha, a( 1, nk+1 ), lda,
506 CALL cgemm(
'C',
'N', nk, nk, k, calpha, a( 1, 1 ),
507 $ lda, a( 1, nk+1 ), lda, cbeta,
508 $ c( ( ( nk+1 )*nk )+1 ), nk )
520 CALL cherk(
'U',
'N', nk, k, alpha, a( 1, 1 ), lda,
521 $ beta, c( nk*( nk+1 )+1 ), nk )
522 CALL cherk(
'L',
'N', nk, k, alpha, a( nk+1, 1 ), lda,
523 $ beta, c( nk*nk+1 ), nk )
524 CALL cgemm(
'N',
'C', nk, nk, k, calpha, a( nk+1, 1 ),
525 $ lda, a( 1, 1 ), lda, cbeta, c( 1 ), nk )
531 CALL cherk(
'U',
'C', nk, k, alpha, a( 1, 1 ), lda,
532 $ beta, c( nk*( nk+1 )+1 ), nk )
533 CALL cherk(
'L',
'C', nk, k, alpha, a( 1, nk+1 ), lda,
534 $ beta, c( nk*nk+1 ), nk )
535 CALL cgemm(
'C',
'N', nk, nk, k, calpha, a( 1, nk+1 ),
536 $ lda, a( 1, 1 ), lda, cbeta, c( 1 ), nk )
subroutine xerbla(srname, info)
subroutine cgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
CGEMM
subroutine cherk(uplo, trans, n, k, alpha, a, lda, beta, c, ldc)
CHERK
subroutine chfrk(transr, uplo, trans, n, k, alpha, a, lda, beta, c)
CHFRK performs a Hermitian rank-k operation for matrix in RFP format.