162 CHARACTER DIAG, TRANS, UPLO
163 INTEGER INFO, LDA, LDB, N, NRHS
167 COMPLEX A( LDA, * ), B( LDB, * )
174 parameter( cone = ( 1.0e+0, 0.0e+0 ) )
179 COMPLEX D11, D12, D21, D22, T1, T2
189 INTRINSIC abs, conjg, max
196 IF( .NOT.lsame( uplo,
'U' ) .AND. .NOT.lsame( uplo,
'L' ) )
THEN
198 ELSE IF( .NOT.lsame( trans,
'N' ) .AND. .NOT.lsame( trans,
'C' ) )
201 ELSE IF( .NOT.lsame( diag,
'U' ) .AND. .NOT.lsame( diag,
'N' ) )
204 ELSE IF( n.LT.0 )
THEN
206 ELSE IF( lda.LT.max( 1, n ) )
THEN
208 ELSE IF( ldb.LT.max( 1, n ) )
THEN
212 CALL xerbla(
'CLAVHE_ROOK ', -info )
221 nounit = lsame( diag,
'N' )
227 IF( lsame( trans,
'N' ) )
THEN
232 IF( lsame( uplo,
'U' ) )
THEN
240 IF( ipiv( k ).GT.0 )
THEN
247 $
CALL cscal( nrhs, a( k, k ), b( k, 1 ), ldb )
255 CALL cgeru( k-1, nrhs, cone, a( 1, k ), 1, b( k, 1 ),
256 $ ldb, b( 1, 1 ), ldb )
262 $
CALL cswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
279 b( k, j ) = d11*t1 + d12*t2
280 b( k+1, j ) = d21*t1 + d22*t2
290 CALL cgeru( k-1, nrhs, cone, a( 1, k ), 1, b( k, 1 ),
291 $ ldb, b( 1, 1 ), ldb )
292 CALL cgeru( k-1, nrhs, cone, a( 1, k+1 ), 1,
293 $ b( k+1, 1 ), ldb, b( 1, 1 ), ldb )
300 kp = abs( ipiv( k ) )
302 $
CALL cswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
306 kp = abs( ipiv( k+1 ) )
308 $
CALL cswap( nrhs, b( k+1, 1 ), ldb, b( kp, 1 ),
331 IF( ipiv( k ).GT.0 )
THEN
338 $
CALL cscal( nrhs, a( k, k ), b( k, 1 ), ldb )
347 CALL cgeru( n-k, nrhs, cone, a( k+1, k ), 1,
348 $ b( k, 1 ), ldb, b( k+1, 1 ), ldb )
354 $
CALL cswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
372 b( k-1, j ) = d11*t1 + d12*t2
373 b( k, j ) = d21*t1 + d22*t2
383 CALL cgeru( n-k, nrhs, cone, a( k+1, k ), 1,
384 $ b( k, 1 ), ldb, b( k+1, 1 ), ldb )
385 CALL cgeru( n-k, nrhs, cone, a( k+1, k-1 ), 1,
386 $ b( k-1, 1 ), ldb, b( k+1, 1 ), ldb )
394 kp = abs( ipiv( k ) )
396 $
CALL cswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
400 kp = abs( ipiv( k-1 ) )
402 $
CALL cswap( nrhs, b( k-1, 1 ), ldb, b( kp, 1 ),
422 IF( lsame( uplo,
'U' ) )
THEN
432 IF( ipiv( k ).GT.0 )
THEN
439 $
CALL cswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
445 CALL clacgv( nrhs, b( k, 1 ), ldb )
446 CALL cgemv(
'Conjugate', k-1, nrhs, cone, b, ldb,
447 $ a( 1, k ), 1, cone, b( k, 1 ), ldb )
448 CALL clacgv( nrhs, b( k, 1 ), ldb )
451 $
CALL cscal( nrhs, a( k, k ), b( k, 1 ), ldb )
461 kp = abs( ipiv( k ) )
463 $
CALL cswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
467 kp = abs( ipiv( k-1 ) )
469 $
CALL cswap( nrhs, b( k-1, 1 ), ldb, b( kp, 1 ),
477 CALL clacgv( nrhs, b( k, 1 ), ldb )
478 CALL cgemv(
'Conjugate', k-2, nrhs, cone, b, ldb,
479 $ a( 1, k ), 1, cone, b( k, 1 ), ldb )
480 CALL clacgv( nrhs, b( k, 1 ), ldb )
482 CALL clacgv( nrhs, b( k-1, 1 ), ldb )
483 CALL cgemv(
'Conjugate', k-2, nrhs, cone, b, ldb,
484 $ a( 1, k-1 ), 1, cone, b( k-1, 1 ), ldb )
485 CALL clacgv( nrhs, b( k-1, 1 ), ldb )
498 b( k-1, j ) = d11*t1 + d12*t2
499 b( k, j ) = d21*t1 + d22*t2
522 IF( ipiv( k ).GT.0 )
THEN
529 $
CALL cswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
533 CALL clacgv( nrhs, b( k, 1 ), ldb )
534 CALL cgemv(
'Conjugate', n-k, nrhs, cone, b( k+1, 1 ),
535 $ ldb, a( k+1, k ), 1, cone, b( k, 1 ), ldb )
536 CALL clacgv( nrhs, b( k, 1 ), ldb )
539 $
CALL cscal( nrhs, a( k, k ), b( k, 1 ), ldb )
549 kp = abs( ipiv( k ) )
551 $
CALL cswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
555 kp = abs( ipiv( k+1 ) )
557 $
CALL cswap( nrhs, b( k+1, 1 ), ldb, b( kp, 1 ),
562 CALL clacgv( nrhs, b( k+1, 1 ), ldb )
563 CALL cgemv(
'Conjugate', n-k-1, nrhs, cone,
564 $ b( k+2, 1 ), ldb, a( k+2, k+1 ), 1, cone,
566 CALL clacgv( nrhs, b( k+1, 1 ), ldb )
568 CALL clacgv( nrhs, b( k, 1 ), ldb )
569 CALL cgemv(
'Conjugate', n-k-1, nrhs, cone,
570 $ b( k+2, 1 ), ldb, a( k+2, k ), 1, cone,
572 CALL clacgv( nrhs, b( k, 1 ), ldb )
585 b( k, j ) = d11*t1 + d12*t2
586 b( k+1, j ) = d21*t1 + d22*t2
subroutine xerbla(srname, info)
subroutine clavhe_rook(uplo, trans, diag, n, nrhs, a, lda, ipiv, b, ldb, info)
CLAVHE_ROOK
subroutine cgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
CGEMV
subroutine cgeru(m, n, alpha, x, incx, y, incy, a, lda)
CGERU
subroutine clacgv(n, x, incx)
CLACGV conjugates a complex vector.
subroutine cscal(n, ca, cx, incx)
CSCAL
subroutine cswap(n, cx, incx, cy, incy)
CSWAP