LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
csytrs_aa_2stage.f
Go to the documentation of this file.
1*> \brief \b CSYTRS_AA_2STAGE
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> Download CSYTRS_AA_2STAGE + dependencies
9*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/csytrs_aa_2stage.f">
10*> [TGZ]</a>
11*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/csytrs_aa_2stage.f">
12*> [ZIP]</a>
13*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/csytrs_aa_2stage.f">
14*> [TXT]</a>
15*
16* Definition:
17* ===========
18*
19* SUBROUTINE CSYTRS_AA_2STAGE( UPLO, N, NRHS, A, LDA, TB, LTB, IPIV,
20* IPIV2, B, LDB, INFO )
21*
22* .. Scalar Arguments ..
23* CHARACTER UPLO
24* INTEGER N, NRHS, LDA, LTB, LDB, INFO
25* ..
26* .. Array Arguments ..
27* INTEGER IPIV( * ), IPIV2( * )
28* COMPLEX A( LDA, * ), TB( * ), B( LDB, * )
29* ..
30*
31*> \par Purpose:
32* =============
33*>
34*> \verbatim
35*>
36*> CSYTRS_AA_2STAGE solves a system of linear equations A*X = B with a complex
37*> symmetric matrix A using the factorization A = U**T*T*U or
38*> A = L*T*L**T computed by CSYTRF_AA_2STAGE.
39*> \endverbatim
40*
41* Arguments:
42* ==========
43*
44*> \param[in] UPLO
45*> \verbatim
46*> UPLO is CHARACTER*1
47*> Specifies whether the details of the factorization are stored
48*> as an upper or lower triangular matrix.
49*> = 'U': Upper triangular, form is A = U**T*T*U;
50*> = 'L': Lower triangular, form is A = L*T*L**T.
51*> \endverbatim
52*>
53*> \param[in] N
54*> \verbatim
55*> N is INTEGER
56*> The order of the matrix A. N >= 0.
57*> \endverbatim
58*>
59*> \param[in] NRHS
60*> \verbatim
61*> NRHS is INTEGER
62*> The number of right hand sides, i.e., the number of columns
63*> of the matrix B. NRHS >= 0.
64*> \endverbatim
65*>
66*> \param[in] A
67*> \verbatim
68*> A is COMPLEX array, dimension (LDA,N)
69*> Details of factors computed by CSYTRF_AA_2STAGE.
70*> \endverbatim
71*>
72*> \param[in] LDA
73*> \verbatim
74*> LDA is INTEGER
75*> The leading dimension of the array A. LDA >= max(1,N).
76*> \endverbatim
77*>
78*> \param[out] TB
79*> \verbatim
80*> TB is COMPLEX array, dimension (LTB)
81*> Details of factors computed by CSYTRF_AA_2STAGE.
82*> \endverbatim
83*>
84*> \param[in] LTB
85*> \verbatim
86*> LTB is INTEGER
87*> The size of the array TB. LTB >= 4*N.
88*> \endverbatim
89*>
90*> \param[in] IPIV
91*> \verbatim
92*> IPIV is INTEGER array, dimension (N)
93*> Details of the interchanges as computed by
94*> CSYTRF_AA_2STAGE.
95*> \endverbatim
96*>
97*> \param[in] IPIV2
98*> \verbatim
99*> IPIV2 is INTEGER array, dimension (N)
100*> Details of the interchanges as computed by
101*> CSYTRF_AA_2STAGE.
102*> \endverbatim
103*>
104*> \param[in,out] B
105*> \verbatim
106*> B is COMPLEX array, dimension (LDB,NRHS)
107*> On entry, the right hand side matrix B.
108*> On exit, the solution matrix X.
109*> \endverbatim
110*>
111*> \param[in] LDB
112*> \verbatim
113*> LDB is INTEGER
114*> The leading dimension of the array B. LDB >= max(1,N).
115*> \endverbatim
116*>
117*> \param[out] INFO
118*> \verbatim
119*> INFO is INTEGER
120*> = 0: successful exit
121*> < 0: if INFO = -i, the i-th argument had an illegal value
122*> \endverbatim
123*
124* Authors:
125* ========
126*
127*> \author Univ. of Tennessee
128*> \author Univ. of California Berkeley
129*> \author Univ. of Colorado Denver
130*> \author NAG Ltd.
131*
132*> \ingroup hetrs_aa_2stage
133*
134* =====================================================================
135 SUBROUTINE csytrs_aa_2stage( UPLO, N, NRHS, A, LDA, TB, LTB,
136 $ IPIV, IPIV2, B, LDB, INFO )
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 A( LDA, * ), TB( * ), B( LDB, * )
151* ..
152*
153* =====================================================================
154*
155 COMPLEX 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 cgbtrs, claswp, ctrsm, 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( 'CSYTRS_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 claswp( nrhs, b, ldb, nb+1, n, ipiv, 1 )
213*
214* Compute (U**T \ B) -> B [ (U**T \P**T * B) ]
215*
216 CALL ctrsm( '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 cgbtrs( '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 ctrsm( '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 claswp( 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 claswp( nrhs, b, ldb, nb+1, n, ipiv, 1 )
249*
250* Compute (L \ B) -> B [ (L \P**T * B) ]
251*
252 CALL ctrsm( '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 cgbtrs( '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 ctrsm( '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 claswp( nrhs, b, ldb, nb+1, n, ipiv, -1 )
273*
274 END IF
275 END IF
276*
277 RETURN
278*
279* End of CSYTRS_AA_2STAGE
280*
281 END
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:137
subroutine csytrs_aa_2stage(uplo, n, nrhs, a, lda, tb, ltb, ipiv, ipiv2, b, ldb, info)
CSYTRS_AA_2STAGE
subroutine claswp(n, a, lda, k1, k2, ipiv, incx)
CLASWP performs a series of row interchanges on a general rectangular matrix.
Definition claswp.f:113
subroutine ctrsm(side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb)
CTRSM
Definition ctrsm.f:180