LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ zsytrs_aa_2stage()

subroutine zsytrs_aa_2stage ( character uplo,
integer n,
integer nrhs,
complex*16, dimension( lda, * ) a,
integer lda,
complex*16, dimension( * ) tb,
integer ltb,
integer, dimension( * ) ipiv,
integer, dimension( * ) ipiv2,
complex*16, dimension( ldb, * ) b,
integer ldb,
integer info )

ZSYTRS_AA_2STAGE

Download ZSYTRS_AA_2STAGE + dependencies [TGZ] [ZIP] [TXT]

Purpose:
!>
!> ZSYTRS_AA_2STAGE solves a system of linear equations A*X = B with a complex
!> symmetric matrix A using the factorization A = U**T*T*U or
!> A = L*T*L**T computed by ZSYTRF_AA_2STAGE.
!> 
Parameters
[in]UPLO
!>          UPLO is CHARACTER*1
!>          Specifies whether the details of the factorization are stored
!>          as an upper or lower triangular matrix.
!>          = 'U':  Upper triangular, form is A = U**T*T*U;
!>          = 'L':  Lower triangular, form is A = L*T*L**T.
!> 
[in]N
!>          N is INTEGER
!>          The order of the matrix A.  N >= 0.
!> 
[in]NRHS
!>          NRHS is INTEGER
!>          The number of right hand sides, i.e., the number of columns
!>          of the matrix B.  NRHS >= 0.
!> 
[in]A
!>          A is COMPLEX*16 array, dimension (LDA,N)
!>          Details of factors computed by ZSYTRF_AA_2STAGE.
!> 
[in]LDA
!>          LDA is INTEGER
!>          The leading dimension of the array A.  LDA >= max(1,N).
!> 
[out]TB
!>          TB is COMPLEX*16 array, dimension (LTB)
!>          Details of factors computed by ZSYTRF_AA_2STAGE.
!> 
[in]LTB
!>          LTB is INTEGER
!>          The size of the array TB. LTB >= 4*N.
!> 
[in]IPIV
!>          IPIV is INTEGER array, dimension (N)
!>          Details of the interchanges as computed by
!>          ZSYTRF_AA_2STAGE.
!> 
[in]IPIV2
!>          IPIV2 is INTEGER array, dimension (N)
!>          Details of the interchanges as computed by
!>          ZSYTRF_AA_2STAGE.
!> 
[in,out]B
!>          B is COMPLEX*16 array, dimension (LDB,NRHS)
!>          On entry, the right hand side matrix B.
!>          On exit, the solution matrix X.
!> 
[in]LDB
!>          LDB is INTEGER
!>          The leading dimension of the array B.  LDB >= max(1,N).
!> 
[out]INFO
!>          INFO is INTEGER
!>          = 0:  successful exit
!>          < 0:  if INFO = -i, the i-th argument had an illegal value
!> 
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 135 of file zsytrs_aa_2stage.f.

137*
138* -- LAPACK computational routine --
139* -- LAPACK is a software package provided by Univ. of Tennessee, --
140* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
141*
142 IMPLICIT NONE
143*
144* .. Scalar Arguments ..
145 CHARACTER UPLO
146 INTEGER N, NRHS, LDA, LTB, LDB, INFO
147* ..
148* .. Array Arguments ..
149 INTEGER IPIV( * ), IPIV2( * )
150 COMPLEX*16 A( LDA, * ), TB( * ), B( LDB, * )
151* ..
152*
153* =====================================================================
154*
155 COMPLEX*16 ONE
156 parameter( one = ( 1.0e+0, 0.0e+0 ) )
157* ..
158* .. Local Scalars ..
159 INTEGER LDTB, NB
160 LOGICAL UPPER
161* ..
162* .. External Functions ..
163 LOGICAL LSAME
164 EXTERNAL lsame
165* ..
166* .. External Subroutines ..
167 EXTERNAL zgbtrs, zlaswp, ztrsm, xerbla
168* ..
169* .. Intrinsic Functions ..
170 INTRINSIC max
171* ..
172* .. Executable Statements ..
173*
174 info = 0
175 upper = lsame( uplo, 'U' )
176 IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
177 info = -1
178 ELSE IF( n.LT.0 ) THEN
179 info = -2
180 ELSE IF( nrhs.LT.0 ) THEN
181 info = -3
182 ELSE IF( lda.LT.max( 1, n ) ) THEN
183 info = -5
184 ELSE IF( ltb.LT.( 4*n ) ) THEN
185 info = -7
186 ELSE IF( ldb.LT.max( 1, n ) ) THEN
187 info = -11
188 END IF
189 IF( info.NE.0 ) THEN
190 CALL xerbla( 'ZSYTRS_AA_2STAGE', -info )
191 RETURN
192 END IF
193*
194* Quick return if possible
195*
196 IF( n.EQ.0 .OR. nrhs.EQ.0 )
197 $ RETURN
198*
199* Read NB and compute LDTB
200*
201 nb = int( tb( 1 ) )
202 ldtb = ltb/n
203*
204 IF( upper ) THEN
205*
206* Solve A*X = B, where A = U**T*T*U.
207*
208 IF( n.GT.nb ) THEN
209*
210* Pivot, P**T * B -> B
211*
212 CALL zlaswp( nrhs, b, ldb, nb+1, n, ipiv, 1 )
213*
214* Compute (U**T \ B) -> B [ (U**T \P**T * B) ]
215*
216 CALL ztrsm( 'L', 'U', 'T', 'U', n-nb, nrhs, one, a(1,
217 $ nb+1),
218 $ lda, b(nb+1, 1), ldb)
219*
220 END IF
221*
222* Compute T \ B -> B [ T \ (U**T \P**T * B) ]
223*
224 CALL zgbtrs( 'N', n, nb, nb, nrhs, tb, ldtb, ipiv2, b, ldb,
225 $ info)
226 IF( n.GT.nb ) THEN
227*
228* Compute (U \ B) -> B [ U \ (T \ (U**T \P**T * B) ) ]
229*
230 CALL ztrsm( 'L', 'U', 'N', 'U', n-nb, nrhs, one, a(1,
231 $ nb+1),
232 $ lda, b(nb+1, 1), ldb)
233*
234* Pivot, P * B -> B [ P * (U \ (T \ (U**T \P**T * B) )) ]
235*
236 CALL zlaswp( nrhs, b, ldb, nb+1, n, ipiv, -1 )
237*
238 END IF
239*
240 ELSE
241*
242* Solve A*X = B, where A = L*T*L**T.
243*
244 IF( n.GT.nb ) THEN
245*
246* Pivot, P**T * B -> B
247*
248 CALL zlaswp( nrhs, b, ldb, nb+1, n, ipiv, 1 )
249*
250* Compute (L \ B) -> B [ (L \P**T * B) ]
251*
252 CALL ztrsm( 'L', 'L', 'N', 'U', n-nb, nrhs, one, a(nb+1,
253 $ 1),
254 $ lda, b(nb+1, 1), ldb)
255*
256 END IF
257*
258* Compute T \ B -> B [ T \ (L \P**T * B) ]
259*
260 CALL zgbtrs( 'N', n, nb, nb, nrhs, tb, ldtb, ipiv2, b, ldb,
261 $ info)
262 IF( n.GT.nb ) THEN
263*
264* Compute (L**T \ B) -> B [ L**T \ (T \ (L \P**T * B) ) ]
265*
266 CALL ztrsm( 'L', 'L', 'T', 'U', n-nb, nrhs, one, a(nb+1,
267 $ 1),
268 $ lda, b(nb+1, 1), ldb)
269*
270* Pivot, P * B -> B [ P * (L**T \ (T \ (L \P**T * B) )) ]
271*
272 CALL zlaswp( nrhs, b, ldb, nb+1, n, ipiv, -1 )
273*
274 END IF
275 END IF
276*
277 RETURN
278*
279* End of ZSYTRS_AA_2STAGE
280*
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine zgbtrs(trans, n, kl, ku, nrhs, ab, ldab, ipiv, b, ldb, info)
ZGBTRS
Definition zgbtrs.f:137
subroutine zlaswp(n, a, lda, k1, k2, ipiv, incx)
ZLASWP performs a series of row interchanges on a general rectangular matrix.
Definition zlaswp.f:113
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48
subroutine ztrsm(side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb)
ZTRSM
Definition ztrsm.f:180
Here is the call graph for this function:
Here is the caller graph for this function: