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

## ◆ zsytrs_aa()

 subroutine zsytrs_aa ( character uplo, integer n, integer nrhs, complex*16, dimension( lda, * ) a, integer lda, integer, dimension( * ) ipiv, complex*16, dimension( ldb, * ) b, integer ldb, complex*16, dimension( * ) work, integer lwork, integer info )

ZSYTRS_AA

Purpose:
``` ZSYTRS_AA 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.```
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.``` [in] LDA ``` LDA is INTEGER The leading dimension of the array A. LDA >= max(1,N).``` [in] IPIV ``` IPIV is INTEGER array, dimension (N) Details of the interchanges as computed by ZSYTRF_AA.``` [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] WORK ` WORK is COMPLEX*16 array, dimension (MAX(1,LWORK))` [in] LWORK ``` LWORK is INTEGER The dimension of the array WORK. LWORK >= max(1,3*N-2).``` [out] INFO ``` INFO is INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value```

Definition at line 129 of file zsytrs_aa.f.

131*
132* -- LAPACK computational routine --
133* -- LAPACK is a software package provided by Univ. of Tennessee, --
134* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
135*
136 IMPLICIT NONE
137*
138* .. Scalar Arguments ..
139 CHARACTER UPLO
140 INTEGER N, NRHS, LDA, LDB, LWORK, INFO
141* ..
142* .. Array Arguments ..
143 INTEGER IPIV( * )
144 COMPLEX*16 A( LDA, * ), B( LDB, * ), WORK( * )
145* ..
146*
147* =====================================================================
148*
149 COMPLEX*16 ONE
150 parameter( one = 1.0d+0 )
151* ..
152* .. Local Scalars ..
153 LOGICAL LQUERY, UPPER
154 INTEGER K, KP, LWKOPT
155* ..
156* .. External Functions ..
157 LOGICAL LSAME
158 EXTERNAL lsame
159* ..
160* .. External Subroutines ..
161 EXTERNAL zgtsv, zswap, zlacpy, ztrsm, xerbla
162* ..
163* .. Intrinsic Functions ..
164 INTRINSIC max
165* ..
166* .. Executable Statements ..
167*
168 info = 0
169 upper = lsame( uplo, 'U' )
170 lquery = ( lwork.EQ.-1 )
171 IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
172 info = -1
173 ELSE IF( n.LT.0 ) THEN
174 info = -2
175 ELSE IF( nrhs.LT.0 ) THEN
176 info = -3
177 ELSE IF( lda.LT.max( 1, n ) ) THEN
178 info = -5
179 ELSE IF( ldb.LT.max( 1, n ) ) THEN
180 info = -8
181 ELSE IF( lwork.LT.max( 1, 3*n-2 ) .AND. .NOT.lquery ) THEN
182 info = -10
183 END IF
184 IF( info.NE.0 ) THEN
185 CALL xerbla( 'ZSYTRS_AA', -info )
186 RETURN
187 ELSE IF( lquery ) THEN
188 lwkopt = (3*n-2)
189 work( 1 ) = lwkopt
190 RETURN
191 END IF
192*
193* Quick return if possible
194*
195 IF( n.EQ.0 .OR. nrhs.EQ.0 )
196 \$ RETURN
197*
198 IF( upper ) THEN
199*
200* Solve A*X = B, where A = U**T*T*U.
201*
202* 1) Forward substitution with U**T
203*
204 IF( n.GT.1 ) THEN
205*
206* Pivot, P**T * B -> B
207*
208 DO k = 1, n
209 kp = ipiv( k )
210 IF( kp.NE.k )
211 \$ CALL zswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
212 END DO
213*
214* Compute U**T \ B -> B [ (U**T \P**T * B) ]
215*
216 CALL ztrsm( 'L', 'U', 'T', 'U', n-1, nrhs, one, a( 1, 2 ),
217 \$ lda, b( 2, 1 ), ldb)
218 END IF
219*
220* 2) Solve with triangular matrix T
221*
222* Compute T \ B -> B [ T \ (U**T \P**T * B) ]
223*
224 CALL zlacpy( 'F', 1, n, a( 1, 1 ), lda+1, work( n ), 1)
225 IF( n.GT.1 ) THEN
226 CALL zlacpy( 'F', 1, n-1, a( 1, 2 ), lda+1, work( 1 ), 1 )
227 CALL zlacpy( 'F', 1, n-1, a( 1, 2 ), lda+1, work( 2*n ), 1 )
228 END IF
229 CALL zgtsv( n, nrhs, work( 1 ), work( n ), work( 2*n ), b, ldb,
230 \$ info )
231*
232* 3) Backward substitution with U
233*
234 IF( n.GT.1 ) THEN
235*
236* Compute U \ B -> B [ U \ (T \ (U**T \P**T * B) ) ]
237*
238 CALL ztrsm( 'L', 'U', 'N', 'U', n-1, nrhs, one, a( 1, 2 ),
239 \$ lda, b( 2, 1 ), ldb)
240*
241* Pivot, P * B -> B [ P * (U \ (T \ (U**T \P**T * B) )) ]
242*
243 DO k = n, 1, -1
244 kp = ipiv( k )
245 IF( kp.NE.k )
246 \$ CALL zswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
247 END DO
248 END IF
249*
250 ELSE
251*
252* Solve A*X = B, where A = L*T*L**T.
253*
254* 1) Forward substitution with L
255*
256 IF( n.GT.1 ) THEN
257*
258* Pivot, P**T * B -> B
259*
260 DO k = 1, n
261 kp = ipiv( k )
262 IF( kp.NE.k )
263 \$ CALL zswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
264 END DO
265*
266* Compute L \ B -> B [ (L \P**T * B) ]
267*
268 CALL ztrsm( 'L', 'L', 'N', 'U', n-1, nrhs, one, a( 2, 1 ),
269 \$ lda, b( 2, 1 ), ldb)
270 END IF
271*
272* 2) Solve with triangular matrix T
273*
274* Compute T \ B -> B [ T \ (L \P**T * B) ]
275*
276 CALL zlacpy( 'F', 1, n, a(1, 1), lda+1, work(n), 1)
277 IF( n.GT.1 ) THEN
278 CALL zlacpy( 'F', 1, n-1, a( 2, 1 ), lda+1, work( 1 ), 1 )
279 CALL zlacpy( 'F', 1, n-1, a( 2, 1 ), lda+1, work( 2*n ), 1 )
280 END IF
281 CALL zgtsv( n, nrhs, work( 1 ), work(n), work( 2*n ), b, ldb,
282 \$ info)
283*
284* 3) Backward substitution with L**T
285*
286 IF( n.GT.1 ) THEN
287*
288* Compute (L**T \ B) -> B [ L**T \ (T \ (L \P**T * B) ) ]
289*
290 CALL ztrsm( 'L', 'L', 'T', 'U', n-1, nrhs, one, a( 2, 1 ),
291 \$ lda, b( 2, 1 ), ldb)
292*
293* Pivot, P * B -> B [ P * (L**T \ (T \ (L \P**T * B) )) ]
294*
295 DO k = n, 1, -1
296 kp = ipiv( k )
297 IF( kp.NE.k )
298 \$ CALL zswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
299 END DO
300 END IF
301*
302 END IF
303*
304 RETURN
305*
306* End of ZSYTRS_AA
307*
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine zgtsv(n, nrhs, dl, d, du, b, ldb, info)
ZGTSV computes the solution to system of linear equations A * X = B for GT matrices
Definition zgtsv.f:124
subroutine zlacpy(uplo, m, n, a, lda, b, ldb)
ZLACPY copies all or part of one two-dimensional array to another.
Definition zlacpy.f:103
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48
subroutine zswap(n, zx, incx, zy, incy)
ZSWAP
Definition zswap.f:81
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: