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

◆ chetrs_aa_2stage()

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

CHETRS_AA_2STAGE

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

Purpose:
 CHETRS_AA_2STAGE solves a system of linear equations A*X = B with a real
 hermitian matrix A using the factorization A = U**T*T*U or
 A = L*T*L**T computed by CHETRF_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 array, dimension (LDA,N)
          Details of factors computed by CHETRF_AA_2STAGE.
[in]LDA
          LDA is INTEGER
          The leading dimension of the array A.  LDA >= max(1,N).
[out]TB
          TB is COMPLEX array, dimension (LTB)
          Details of factors computed by CHETRF_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
          CHETRF_AA_2STAGE.
[in]IPIV2
          IPIV2 is INTEGER array, dimension (N)
          Details of the interchanges as computed by
          CHETRF_AA_2STAGE.
[in,out]B
          B is COMPLEX 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 139 of file chetrs_aa_2stage.f.

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