133 SUBROUTINE chetrs_aa( UPLO, N, NRHS, A, LDA, IPIV, B, LDB,
134 $ WORK, LWORK, INFO )
144 INTEGER N, NRHS, LDA, LDB, LWORK, INFO
148 COMPLEX A( LDA, * ), B( LDB, * ), WORK( * )
154 parameter( one = 1.0e+0 )
157 LOGICAL LQUERY, UPPER
158 INTEGER K, KP, LWKMIN
163 EXTERNAL lsame, sroundup_lwork
175 upper = lsame( uplo,
'U' )
176 lquery = ( lwork.EQ.-1 )
177 IF( min( n, nrhs ).EQ.0 )
THEN
183 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
185 ELSE IF( n.LT.0 )
THEN
187 ELSE IF( nrhs.LT.0 )
THEN
189 ELSE IF( lda.LT.max( 1, n ) )
THEN
191 ELSE IF( ldb.LT.max( 1, n ) )
THEN
193 ELSE IF( lwork.LT.lwkmin .AND. .NOT.lquery )
THEN
197 CALL xerbla(
'CHETRS_AA', -info )
199 ELSE IF( lquery )
THEN
200 work( 1 ) = sroundup_lwork( lwkmin )
206 IF( min( n, nrhs ).EQ.0 )
223 $
CALL cswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
229 CALL ctrsm(
'L',
'U',
'C',
'U', n-1, nrhs, one, a( 1,
231 $ lda, b( 2, 1 ), ldb)
238 CALL clacpy(
'F', 1, n, a(1, 1), lda+1, work(n), 1)
240 CALL clacpy(
'F', 1, n-1, a( 1, 2 ), lda+1, work( 2*n ),
242 CALL clacpy(
'F', 1, n-1, a( 1, 2 ), lda+1, work( 1 ),
244 CALL clacgv( n-1, work( 1 ), 1 )
246 CALL cgtsv(n, nrhs, work(1), work(n), work(2*n), b, ldb,
255 CALL ctrsm(
'L',
'U',
'N',
'U', n-1, nrhs, one, a( 1,
265 $
CALL cswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
284 $
CALL cswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
290 CALL ctrsm(
'L',
'L',
'N',
'U', n-1, nrhs, one, a( 2, 1),
291 $ lda, b(2, 1), ldb )
298 CALL clacpy(
'F', 1, n, a(1, 1), lda+1, work(n), 1)
300 CALL clacpy(
'F', 1, n-1, a( 2, 1 ), lda+1, work( 1 ),
302 CALL clacpy(
'F', 1, n-1, a( 2, 1 ), lda+1, work( 2*n ),
304 CALL clacgv( n-1, work( 2*n ), 1 )
306 CALL cgtsv(n, nrhs, work(1), work(n), work(2*n), b, ldb,
315 CALL ctrsm(
'L',
'L',
'C',
'U', n-1, nrhs, one, a( 2,
317 $ lda, b( 2, 1 ), ldb )
325 $
CALL cswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
subroutine cgtsv(n, nrhs, dl, d, du, b, ldb, info)
CGTSV computes the solution to system of linear equations A * X = B for GT matrices