138 SUBROUTINE zlavhe( UPLO, TRANS, DIAG, N, NRHS, A, LDA, IPIV, B,
147 CHARACTER diag, trans, uplo
148 INTEGER info, lda, ldb, n, nrhs
152 COMPLEX*16 a( lda, * ), b( ldb, * )
159 parameter( one = ( 1.0d+0, 0.0d+0 ) )
164 COMPLEX*16 d11, d12, d21, d22, t1, t2
174 INTRINSIC abs, dconjg, 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(
'ZLAVHE ', -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
zscal( nrhs, a( k, k ), b( k, 1 ), ldb )
240 CALL
zgeru( k-1, nrhs, one, a( 1, k ), 1, b( k, 1 ),
241 $ ldb, b( 1, 1 ), ldb )
247 $ CALL
zswap( 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
zgeru( k-1, nrhs, one, a( 1, k ), 1, b( k, 1 ),
276 $ ldb, b( 1, 1 ), ldb )
277 CALL
zgeru( 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
zswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
306 IF( ipiv( k ).GT.0 )
THEN
313 $ CALL
zscal( nrhs, a( k, k ), b( k, 1 ), ldb )
322 CALL
zgeru( n-k, nrhs, one, a( k+1, k ), 1, b( k, 1 ),
323 $ ldb, b( k+1, 1 ), ldb )
329 $ CALL
zswap( 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
zgeru( n-k, nrhs, one, a( k+1, k ), 1, b( k, 1 ),
359 $ ldb, b( k+1, 1 ), ldb )
360 CALL
zgeru( 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
zswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
386 IF(
lsame( uplo,
'U' ) )
THEN
397 IF( ipiv( k ).GT.0 )
THEN
404 $ CALL
zswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
410 CALL
zlacgv( nrhs, b( k, 1 ), ldb )
411 CALL
zgemv(
'Conjugate', k-1, nrhs, one, b, ldb,
412 $ a( 1, k ), 1, one, b( k, 1 ), ldb )
413 CALL
zlacgv( nrhs, b( k, 1 ), ldb )
416 $ CALL
zscal( nrhs, a( k, k ), b( k, 1 ), ldb )
426 kp = abs( ipiv( k ) )
428 $ CALL
zswap( nrhs, b( k-1, 1 ), ldb, b( kp, 1 ),
436 CALL
zlacgv( nrhs, b( k, 1 ), ldb )
437 CALL
zgemv(
'Conjugate', k-2, nrhs, one, b, ldb,
438 $ a( 1, k ), 1, one, b( k, 1 ), ldb )
439 CALL
zlacgv( nrhs, b( k, 1 ), ldb )
441 CALL
zlacgv( nrhs, b( k-1, 1 ), ldb )
442 CALL
zgemv(
'Conjugate', k-2, nrhs, one, b, ldb,
443 $ a( 1, k-1 ), 1, one, b( k-1, 1 ), ldb )
444 CALL
zlacgv( nrhs, b( k-1, 1 ), ldb )
457 b( k-1, j ) = d11*t1 + d12*t2
458 b( k, j ) = d21*t1 + d22*t2
481 IF( ipiv( k ).GT.0 )
THEN
488 $ CALL
zswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
492 CALL
zlacgv( nrhs, b( k, 1 ), ldb )
493 CALL
zgemv(
'Conjugate', n-k, nrhs, one, b( k+1, 1 ),
494 $ ldb, a( k+1, k ), 1, one, b( k, 1 ), ldb )
495 CALL
zlacgv( nrhs, b( k, 1 ), ldb )
498 $ CALL
zscal( nrhs, a( k, k ), b( k, 1 ), ldb )
508 kp = abs( ipiv( k ) )
510 $ CALL
zswap( nrhs, b( k+1, 1 ), ldb, b( kp, 1 ),
515 CALL
zlacgv( nrhs, b( k+1, 1 ), ldb )
516 CALL
zgemv(
'Conjugate', n-k-1, nrhs, one,
517 $ b( k+2, 1 ), ldb, a( k+2, k+1 ), 1, one,
519 CALL
zlacgv( nrhs, b( k+1, 1 ), ldb )
521 CALL
zlacgv( nrhs, b( k, 1 ), ldb )
522 CALL
zgemv(
'Conjugate', n-k-1, nrhs, one,
523 $ b( k+2, 1 ), ldb, a( k+2, k ), 1, one,
525 CALL
zlacgv( nrhs, b( k, 1 ), ldb )
538 b( k, j ) = d11*t1 + d12*t2
539 b( k+1, j ) = d21*t1 + d22*t2