LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ 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*U**T 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*U**T;
          = '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
          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.
Date
November 2017

Definition at line 142 of file chetrs_aa_2stage.f.

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