127 SUBROUTINE zsytrs_aa( UPLO, N, NRHS, A, LDA, IPIV, B, LDB,
128 $ WORK, LWORK, INFO )
138 INTEGER N, NRHS, LDA, LDB, LWORK, INFO
142 COMPLEX*16 A( LDA, * ), B( LDB, * ), WORK( * )
148 parameter( one = 1.0d+0 )
151 LOGICAL LQUERY, UPPER
152 INTEGER K, KP, LWKOPT
167 upper = lsame( uplo,
'U' )
168 lquery = ( lwork.EQ.-1 )
169 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
171 ELSE IF( n.LT.0 )
THEN
173 ELSE IF( nrhs.LT.0 )
THEN
175 ELSE IF( lda.LT.max( 1, n ) )
THEN
177 ELSE IF( ldb.LT.max( 1, n ) )
THEN
179 ELSE IF( lwork.LT.max( 1, 3*n-2 ) .AND. .NOT.lquery )
THEN
183 CALL xerbla(
'ZSYTRS_AA', -info )
185 ELSE IF( lquery )
THEN
193 IF( n.EQ.0 .OR. nrhs.EQ.0 )
209 $
CALL zswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
214 CALL ztrsm(
'L',
'U',
'T',
'U', n-1, nrhs, one, a( 1,
216 $ lda, b( 2, 1 ), ldb)
223 CALL zlacpy(
'F', 1, n, a( 1, 1 ), lda+1, work( n ), 1)
225 CALL zlacpy(
'F', 1, n-1, a( 1, 2 ), lda+1, work( 1 ),
227 CALL zlacpy(
'F', 1, n-1, a( 1, 2 ), lda+1, work( 2*n ),
230 CALL zgtsv( n, nrhs, work( 1 ), work( n ), work( 2*n ), b,
240 CALL ztrsm(
'L',
'U',
'N',
'U', n-1, nrhs, one, a( 1,
242 $ lda, b( 2, 1 ), ldb)
249 $
CALL zswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
266 $
CALL zswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
271 CALL ztrsm(
'L',
'L',
'N',
'U', n-1, nrhs, one, a( 2,
273 $ lda, b( 2, 1 ), ldb)
280 CALL zlacpy(
'F', 1, n, a(1, 1), lda+1, work(n), 1)
282 CALL zlacpy(
'F', 1, n-1, a( 2, 1 ), lda+1, work( 1 ),
284 CALL zlacpy(
'F', 1, n-1, a( 2, 1 ), lda+1, work( 2*n ),
287 CALL zgtsv( n, nrhs, work( 1 ), work(n), work( 2*n ), b,
297 CALL ztrsm(
'L',
'L',
'T',
'U', n-1, nrhs, one, a( 2,
299 $ lda, b( 2, 1 ), ldb)
306 $
CALL zswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
subroutine zgtsv(n, nrhs, dl, d, du, b, ldb, info)
ZGTSV computes the solution to system of linear equations A * X = B for GT matrices
subroutine ztrsm(side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb)
ZTRSM