LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
zsysv_rook.f
Go to the documentation of this file.
1*> \brief <b> ZSYSV_ROOK computes the solution to system of linear equations A * X = B for SY matrices</b>
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> Download ZSYSV_ROOK + dependencies
9*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zsysv_rook.f">
10*> [TGZ]</a>
11*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zsysv_rook.f">
12*> [ZIP]</a>
13*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zsysv_rook.f">
14*> [TXT]</a>
15*
16* Definition:
17* ===========
18*
19* SUBROUTINE ZSYSV_ROOK( UPLO, N, NRHS, A, LDA, IPIV, B, LDB, WORK,
20* LWORK, INFO )
21*
22* .. Scalar Arguments ..
23* CHARACTER UPLO
24* INTEGER INFO, LDA, LDB, LWORK, N, NRHS
25* ..
26* .. Array Arguments ..
27* INTEGER IPIV( * )
28* COMPLEX*16 A( LDA, * ), B( LDB, * ), WORK( * )
29* ..
30*
31*
32*> \par Purpose:
33* =============
34*>
35*> \verbatim
36*>
37*> ZSYSV_ROOK computes the solution to a complex system of linear
38*> equations
39*> A * X = B,
40*> where A is an N-by-N symmetric matrix and X and B are N-by-NRHS
41*> matrices.
42*>
43*> The diagonal pivoting method is used to factor A as
44*> A = U * D * U**T, if UPLO = 'U', or
45*> A = L * D * L**T, if UPLO = 'L',
46*> where U (or L) is a product of permutation and unit upper (lower)
47*> triangular matrices, and D is symmetric and block diagonal with
48*> 1-by-1 and 2-by-2 diagonal blocks.
49*>
50*> ZSYTRF_ROOK is called to compute the factorization of a complex
51*> symmetric matrix A using the bounded Bunch-Kaufman ("rook") diagonal
52*> pivoting method.
53*>
54*> The factored form of A is then used to solve the system
55*> of equations A * X = B by calling ZSYTRS_ROOK.
56*> \endverbatim
57*
58* Arguments:
59* ==========
60*
61*> \param[in] UPLO
62*> \verbatim
63*> UPLO is CHARACTER*1
64*> = 'U': Upper triangle of A is stored;
65*> = 'L': Lower triangle of A is stored.
66*> \endverbatim
67*>
68*> \param[in] N
69*> \verbatim
70*> N is INTEGER
71*> The number of linear equations, i.e., the order of the
72*> matrix A. N >= 0.
73*> \endverbatim
74*>
75*> \param[in] NRHS
76*> \verbatim
77*> NRHS is INTEGER
78*> The number of right hand sides, i.e., the number of columns
79*> of the matrix B. NRHS >= 0.
80*> \endverbatim
81*>
82*> \param[in,out] A
83*> \verbatim
84*> A is COMPLEX*16 array, dimension (LDA,N)
85*> On entry, the symmetric matrix A. If UPLO = 'U', the leading
86*> N-by-N upper triangular part of A contains the upper
87*> triangular part of the matrix A, and the strictly lower
88*> triangular part of A is not referenced. If UPLO = 'L', the
89*> leading N-by-N lower triangular part of A contains the lower
90*> triangular part of the matrix A, and the strictly upper
91*> triangular part of A is not referenced.
92*>
93*> On exit, if INFO = 0, the block diagonal matrix D and the
94*> multipliers used to obtain the factor U or L from the
95*> factorization A = U*D*U**T or A = L*D*L**T as computed by
96*> ZSYTRF_ROOK.
97*> \endverbatim
98*>
99*> \param[in] LDA
100*> \verbatim
101*> LDA is INTEGER
102*> The leading dimension of the array A. LDA >= max(1,N).
103*> \endverbatim
104*>
105*> \param[out] IPIV
106*> \verbatim
107*> IPIV is INTEGER array, dimension (N)
108*> Details of the interchanges and the block structure of D,
109*> as determined by ZSYTRF_ROOK.
110*>
111*> If UPLO = 'U':
112*> If IPIV(k) > 0, then rows and columns k and IPIV(k)
113*> were interchanged and D(k,k) is a 1-by-1 diagonal block.
114*>
115*> If IPIV(k) < 0 and IPIV(k-1) < 0, then rows and
116*> columns k and -IPIV(k) were interchanged and rows and
117*> columns k-1 and -IPIV(k-1) were inerchaged,
118*> D(k-1:k,k-1:k) is a 2-by-2 diagonal block.
119*>
120*> If UPLO = 'L':
121*> If IPIV(k) > 0, then rows and columns k and IPIV(k)
122*> were interchanged and D(k,k) is a 1-by-1 diagonal block.
123*>
124*> If IPIV(k) < 0 and IPIV(k+1) < 0, then rows and
125*> columns k and -IPIV(k) were interchanged and rows and
126*> columns k+1 and -IPIV(k+1) were inerchaged,
127*> D(k:k+1,k:k+1) is a 2-by-2 diagonal block.
128*> \endverbatim
129*>
130*> \param[in,out] B
131*> \verbatim
132*> B is COMPLEX*16 array, dimension (LDB,NRHS)
133*> On entry, the N-by-NRHS right hand side matrix B.
134*> On exit, if INFO = 0, the N-by-NRHS solution matrix X.
135*> \endverbatim
136*>
137*> \param[in] LDB
138*> \verbatim
139*> LDB is INTEGER
140*> The leading dimension of the array B. LDB >= max(1,N).
141*> \endverbatim
142*>
143*> \param[out] WORK
144*> \verbatim
145*> WORK is COMPLEX*16 array, dimension (MAX(1,LWORK))
146*> On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
147*> \endverbatim
148*>
149*> \param[in] LWORK
150*> \verbatim
151*> LWORK is INTEGER
152*> The length of WORK. LWORK >= 1, and for best performance
153*> LWORK >= max(1,N*NB), where NB is the optimal blocksize for
154*> ZSYTRF_ROOK.
155*>
156*> TRS will be done with Level 2 BLAS
157*>
158*> If LWORK = -1, then a workspace query is assumed; the routine
159*> only calculates the optimal size of the WORK array, returns
160*> this value as the first entry of the WORK array, and no error
161*> message related to LWORK is issued by XERBLA.
162*> \endverbatim
163*>
164*> \param[out] INFO
165*> \verbatim
166*> INFO is INTEGER
167*> = 0: successful exit
168*> < 0: if INFO = -i, the i-th argument had an illegal value
169*> > 0: if INFO = i, D(i,i) is exactly zero. The factorization
170*> has been completed, but the block diagonal matrix D is
171*> exactly singular, so the solution could not be computed.
172*> \endverbatim
173*
174* Authors:
175* ========
176*
177*> \author Univ. of Tennessee
178*> \author Univ. of California Berkeley
179*> \author Univ. of Colorado Denver
180*> \author NAG Ltd.
181*
182*> \ingroup hesv_rook
183*
184*> \par Contributors:
185* ==================
186*>
187*> \verbatim
188*>
189*> December 2016, Igor Kozachenko,
190*> Computer Science Division,
191*> University of California, Berkeley
192*>
193*> September 2007, Sven Hammarling, Nicholas J. Higham, Craig Lucas,
194*> School of Mathematics,
195*> University of Manchester
196*>
197*> \endverbatim
198*
199* =====================================================================
200 SUBROUTINE zsysv_rook( UPLO, N, NRHS, A, LDA, IPIV, B, LDB,
201 $ WORK,
202 $ LWORK, INFO )
203*
204* -- LAPACK driver routine --
205* -- LAPACK is a software package provided by Univ. of Tennessee, --
206* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
207*
208* .. Scalar Arguments ..
209 CHARACTER UPLO
210 INTEGER INFO, LDA, LDB, LWORK, N, NRHS
211* ..
212* .. Array Arguments ..
213 INTEGER IPIV( * )
214 COMPLEX*16 A( LDA, * ), B( LDB, * ), WORK( * )
215* ..
216*
217* =====================================================================
218*
219* .. Local Scalars ..
220 LOGICAL LQUERY
221 INTEGER LWKOPT
222* ..
223* .. External Functions ..
224 LOGICAL LSAME
225 EXTERNAL LSAME
226* ..
227* .. External Subroutines ..
229* ..
230* .. Intrinsic Functions ..
231 INTRINSIC max
232* ..
233* .. Executable Statements ..
234*
235* Test the input parameters.
236*
237 info = 0
238 lquery = ( lwork.EQ.-1 )
239 IF( .NOT.lsame( uplo, 'U' ) .AND.
240 $ .NOT.lsame( uplo, 'L' ) ) THEN
241 info = -1
242 ELSE IF( n.LT.0 ) THEN
243 info = -2
244 ELSE IF( nrhs.LT.0 ) THEN
245 info = -3
246 ELSE IF( lda.LT.max( 1, n ) ) THEN
247 info = -5
248 ELSE IF( ldb.LT.max( 1, n ) ) THEN
249 info = -8
250 ELSE IF( lwork.LT.1 .AND. .NOT.lquery ) THEN
251 info = -10
252 END IF
253*
254 IF( info.EQ.0 ) THEN
255 IF( n.EQ.0 ) THEN
256 lwkopt = 1
257 ELSE
258 CALL zsytrf_rook( uplo, n, a, lda, ipiv, work, -1, info )
259 lwkopt = int( dble( work( 1 ) ) )
260 END IF
261 work( 1 ) = lwkopt
262 END IF
263*
264 IF( info.NE.0 ) THEN
265 CALL xerbla( 'ZSYSV_ROOK ', -info )
266 RETURN
267 ELSE IF( lquery ) THEN
268 RETURN
269 END IF
270*
271* Compute the factorization A = U*D*U**T or A = L*D*L**T.
272*
273 CALL zsytrf_rook( uplo, n, a, lda, ipiv, work, lwork, info )
274 IF( info.EQ.0 ) THEN
275*
276* Solve the system A*X = B, overwriting B with X.
277*
278* Solve with TRS_ROOK ( Use Level 2 BLAS)
279*
280 CALL zsytrs_rook( uplo, n, nrhs, a, lda, ipiv, b, ldb,
281 $ info )
282*
283 END IF
284*
285 work( 1 ) = lwkopt
286*
287 RETURN
288*
289* End of ZSYSV_ROOK
290*
291 END
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine zsysv_rook(uplo, n, nrhs, a, lda, ipiv, b, ldb, work, lwork, info)
ZSYSV_ROOK computes the solution to system of linear equations A * X = B for SY matrices
Definition zsysv_rook.f:203
subroutine zsytrf_rook(uplo, n, a, lda, ipiv, work, lwork, info)
ZSYTRF_ROOK
subroutine zsytrs_rook(uplo, n, nrhs, a, lda, ipiv, b, ldb, info)
ZSYTRS_ROOK