LAPACK  3.8.0 LAPACK: Linear Algebra PACKage

## ◆ zhetrs_aa_2stage()

 subroutine zhetrs_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 )

ZHETRS_AA_2STAGE

Purpose:
``` ZHETRS_AA_2STAGE solves a system of linear equations A*X = B with a
hermitian matrix A using the factorization A = U*T*U**T or
A = L*T*L**T computed by ZHETRF_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*16array, dimension (LDA,N) Details of factors computed by ZHETRF_AA_2STAGE.``` [in] LDA ``` LDA is INTEGER The leading dimension of the array A. LDA >= max(1,N).``` [out] TB ``` TB is COMPLEX*16array, dimension (LTB) Details of factors computed by ZHETRF_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 ZHETRF_AA_2STAGE.``` [in] IPIV2 ``` IPIV2 is INTEGER array, dimension (N) Details of the interchanges as computed by ZHETRF_AA_2STAGE.``` [in,out] B ``` B is COMPLEX*16array, 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```
Date
November 2017

Definition at line 142 of file zhetrs_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*16 a( lda, * ), tb( * ), b( ldb, * )
157 * ..
158 *
159 * =====================================================================
160 *
161  COMPLEX*16 one
162  parameter( one = ( 1.0d+0, 0.0d+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 zgbtrs, zlaswp, ztrsm, 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( 'ZHETRS_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 zlaswp( 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 ztrsm( '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 zgbtrs( '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 ztrsm( '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 zlaswp( 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 zlaswp( nrhs, b, ldb, nb+1, n, ipiv, 1 )
253 *
254 * Compute (L \P**T * B) -> B [ (L \P**T * B) ]
255 *
256  CALL ztrsm( '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 zgbtrs( '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 ztrsm( '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 zlaswp( nrhs, b, ldb, nb+1, n, ipiv, -1 )
275 *
276  END IF
277  END IF
278 *
279  RETURN
280 *
281 * End of ZHETRS_AA_2STAGE
282 *
subroutine zgbtrs(TRANS, N, KL, KU, NRHS, AB, LDAB, IPIV, B, LDB, INFO)
ZGBTRS
Definition: zgbtrs.f:140
subroutine zlaswp(N, A, LDA, K1, K2, IPIV, INCX)
ZLASWP performs a series of row interchanges on a general rectangular matrix.
Definition: zlaswp.f:117
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:62
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55
subroutine ztrsm(SIDE, UPLO, TRANSA, DIAG, M, N, ALPHA, A, LDA, B, LDB)
ZTRSM
Definition: ztrsm.f:182
Here is the call graph for this function:
Here is the caller graph for this function: