138 SUBROUTINE clavhe( UPLO, TRANS, DIAG, N, NRHS, A, LDA, IPIV, B,
147 CHARACTER diag, trans, uplo
148 INTEGER info, lda, ldb, n, nrhs
152 COMPLEX a( lda, * ), b( ldb, * )
159 parameter( one = ( 1.0e+0, 0.0e+0 ) )
164 COMPLEX d11, d12, d21, d22, t1, t2
174 INTRINSIC abs, conjg, max
181 IF( .NOT.
lsame( uplo,
'U' ) .AND. .NOT.
lsame( uplo,
'L' ) )
THEN
183 ELSE IF( .NOT.
lsame( trans,
'N' ) .AND. .NOT.
lsame( trans,
'C' ) )
186 ELSE IF( .NOT.
lsame( diag,
'U' ) .AND. .NOT.
lsame( diag,
'N' ) )
189 ELSE IF( n.LT.0 )
THEN
191 ELSE IF( lda.LT.max( 1, n ) )
THEN
193 ELSE IF( ldb.LT.max( 1, n ) )
THEN
197 CALL
xerbla(
'CLAVHE ', -info )
206 nounit =
lsame( diag,
'N' )
212 IF(
lsame( trans,
'N' ) )
THEN
217 IF(
lsame( uplo,
'U' ) )
THEN
225 IF( ipiv( k ).GT.0 )
THEN
232 $ CALL
cscal( nrhs, a( k, k ), b( k, 1 ), ldb )
240 CALL
cgeru( k-1, nrhs, one, a( 1, k ), 1, b( k, 1 ),
241 $ ldb, b( 1, 1 ), ldb )
247 $ CALL
cswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
264 b( k, j ) = d11*t1 + d12*t2
265 b( k+1, j ) = d21*t1 + d22*t2
275 CALL
cgeru( k-1, nrhs, one, a( 1, k ), 1, b( k, 1 ),
276 $ ldb, b( 1, 1 ), ldb )
277 CALL
cgeru( k-1, nrhs, one, a( 1, k+1 ), 1,
278 $ b( k+1, 1 ), ldb, b( 1, 1 ), ldb )
282 kp = abs( ipiv( k ) )
284 $ CALL
cswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
306 IF( ipiv( k ).GT.0 )
THEN
313 $ CALL
cscal( nrhs, a( k, k ), b( k, 1 ), ldb )
322 CALL
cgeru( n-k, nrhs, one, a( k+1, k ), 1,
323 $ b( k, 1 ), ldb, b( k+1, 1 ), ldb )
329 $ CALL
cswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
347 b( k-1, j ) = d11*t1 + d12*t2
348 b( k, j ) = d21*t1 + d22*t2
358 CALL
cgeru( n-k, nrhs, one, a( k+1, k ), 1,
359 $ b( k, 1 ), ldb, b( k+1, 1 ), ldb )
360 CALL
cgeru( n-k, nrhs, one, a( k+1, k-1 ), 1,
361 $ b( k-1, 1 ), ldb, b( k+1, 1 ), ldb )
366 kp = abs( ipiv( k ) )
368 $ CALL
cswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
386 IF(
lsame( uplo,
'U' ) )
THEN
396 IF( ipiv( k ).GT.0 )
THEN
403 $ CALL
cswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
409 CALL
clacgv( nrhs, b( k, 1 ), ldb )
410 CALL
cgemv(
'Conjugate', k-1, nrhs, one, b, ldb,
411 $ a( 1, k ), 1, one, b( k, 1 ), ldb )
412 CALL
clacgv( nrhs, b( k, 1 ), ldb )
415 $ CALL
cscal( nrhs, a( k, k ), b( k, 1 ), ldb )
425 kp = abs( ipiv( k ) )
427 $ CALL
cswap( nrhs, b( k-1, 1 ), ldb, b( kp, 1 ),
435 CALL
clacgv( nrhs, b( k, 1 ), ldb )
436 CALL
cgemv(
'Conjugate', k-2, nrhs, one, b, ldb,
437 $ a( 1, k ), 1, one, b( k, 1 ), ldb )
438 CALL
clacgv( nrhs, b( k, 1 ), ldb )
440 CALL
clacgv( nrhs, b( k-1, 1 ), ldb )
441 CALL
cgemv(
'Conjugate', k-2, nrhs, one, b, ldb,
442 $ a( 1, k-1 ), 1, one, b( k-1, 1 ), ldb )
443 CALL
clacgv( nrhs, b( k-1, 1 ), ldb )
456 b( k-1, j ) = d11*t1 + d12*t2
457 b( k, j ) = d21*t1 + d22*t2
480 IF( ipiv( k ).GT.0 )
THEN
487 $ CALL
cswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
491 CALL
clacgv( nrhs, b( k, 1 ), ldb )
492 CALL
cgemv(
'Conjugate', n-k, nrhs, one, b( k+1, 1 ),
493 $ ldb, a( k+1, k ), 1, one, b( k, 1 ), ldb )
494 CALL
clacgv( nrhs, b( k, 1 ), ldb )
497 $ CALL
cscal( nrhs, a( k, k ), b( k, 1 ), ldb )
507 kp = abs( ipiv( k ) )
509 $ CALL
cswap( nrhs, b( k+1, 1 ), ldb, b( kp, 1 ),
514 CALL
clacgv( nrhs, b( k+1, 1 ), ldb )
515 CALL
cgemv(
'Conjugate', n-k-1, nrhs, one,
516 $ b( k+2, 1 ), ldb, a( k+2, k+1 ), 1, one,
518 CALL
clacgv( nrhs, b( k+1, 1 ), ldb )
520 CALL
clacgv( nrhs, b( k, 1 ), ldb )
521 CALL
cgemv(
'Conjugate', n-k-1, nrhs, one,
522 $ b( k+2, 1 ), ldb, a( k+2, k ), 1, one,
524 CALL
clacgv( nrhs, b( k, 1 ), ldb )
537 b( k, j ) = d11*t1 + d12*t2
538 b( k+1, j ) = d21*t1 + d22*t2