LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
csycon_rook.f
Go to the documentation of this file.
1*> \brief <b> CSYCON_ROOK </b>
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> Download CSYCON_ROOK + dependencies
9*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/csycon_rook.f">
10*> [TGZ]</a>
11*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/csycon_rook.f">
12*> [ZIP]</a>
13*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/csycon_rook.f">
14*> [TXT]</a>
15*
16* Definition:
17* ===========
18*
19* SUBROUTINE CSYCON_ROOK( UPLO, N, A, LDA, IPIV, ANORM, RCOND,
20* WORK, INFO )
21*
22* .. Scalar Arguments ..
23* CHARACTER UPLO
24* INTEGER INFO, LDA, N
25* REAL ANORM, RCOND
26* ..
27* .. Array Arguments ..
28* INTEGER IPIV( * )
29* COMPLEX A( LDA, * ), WORK( * )
30* ..
31*
32*
33*> \par Purpose:
34* =============
35*>
36*> \verbatim
37*>
38*> CSYCON_ROOK estimates the reciprocal of the condition number (in the
39*> 1-norm) of a complex symmetric matrix A using the factorization
40*> A = U*D*U**T or A = L*D*L**T computed by CSYTRF_ROOK.
41*>
42*> An estimate is obtained for norm(inv(A)), and the reciprocal of the
43*> condition number is computed as RCOND = 1 / (ANORM * norm(inv(A))).
44*> \endverbatim
45*
46* Arguments:
47* ==========
48*
49*> \param[in] UPLO
50*> \verbatim
51*> UPLO is CHARACTER*1
52*> Specifies whether the details of the factorization are stored
53*> as an upper or lower triangular matrix.
54*> = 'U': Upper triangular, form is A = U*D*U**T;
55*> = 'L': Lower triangular, form is A = L*D*L**T.
56*> \endverbatim
57*>
58*> \param[in] N
59*> \verbatim
60*> N is INTEGER
61*> The order of the matrix A. N >= 0.
62*> \endverbatim
63*>
64*> \param[in] A
65*> \verbatim
66*> A is COMPLEX array, dimension (LDA,N)
67*> The block diagonal matrix D and the multipliers used to
68*> obtain the factor U or L as computed by CSYTRF_ROOK.
69*> \endverbatim
70*>
71*> \param[in] LDA
72*> \verbatim
73*> LDA is INTEGER
74*> The leading dimension of the array A. LDA >= max(1,N).
75*> \endverbatim
76*>
77*> \param[in] IPIV
78*> \verbatim
79*> IPIV is INTEGER array, dimension (N)
80*> Details of the interchanges and the block structure of D
81*> as determined by CSYTRF_ROOK.
82*> \endverbatim
83*>
84*> \param[in] ANORM
85*> \verbatim
86*> ANORM is REAL
87*> The 1-norm of the original matrix A.
88*> \endverbatim
89*>
90*> \param[out] RCOND
91*> \verbatim
92*> RCOND is REAL
93*> The reciprocal of the condition number of the matrix A,
94*> computed as RCOND = 1/(ANORM * AINVNM), where AINVNM is an
95*> estimate of the 1-norm of inv(A) computed in this routine.
96*> \endverbatim
97*>
98*> \param[out] WORK
99*> \verbatim
100*> WORK is COMPLEX array, dimension (2*N)
101*> \endverbatim
102*>
103*> \param[out] INFO
104*> \verbatim
105*> INFO is INTEGER
106*> = 0: successful exit
107*> < 0: if INFO = -i, the i-th argument had an illegal value
108*> \endverbatim
109*
110* Authors:
111* ========
112*
113*> \author Univ. of Tennessee
114*> \author Univ. of California Berkeley
115*> \author Univ. of Colorado Denver
116*> \author NAG Ltd.
117*
118*> \ingroup hecon_rook
119*
120*> \par Contributors:
121* ==================
122*> \verbatim
123*>
124*> April 2012, Igor Kozachenko,
125*> Computer Science Division,
126*> University of California, Berkeley
127*>
128*> September 2007, Sven Hammarling, Nicholas J. Higham, Craig Lucas,
129*> School of Mathematics,
130*> University of Manchester
131*>
132*> \endverbatim
133*
134* =====================================================================
135 SUBROUTINE csycon_rook( UPLO, N, A, LDA, IPIV, ANORM, RCOND,
136 $ WORK,
137 $ INFO )
138*
139* -- LAPACK computational routine --
140* -- LAPACK is a software package provided by Univ. of Tennessee, --
141* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
142*
143* .. Scalar Arguments ..
144 CHARACTER UPLO
145 INTEGER INFO, LDA, N
146 REAL ANORM, RCOND
147* ..
148* .. Array Arguments ..
149 INTEGER IPIV( * )
150 COMPLEX A( LDA, * ), WORK( * )
151* ..
152*
153* =====================================================================
154*
155* .. Parameters ..
156 REAL ONE, ZERO
157 PARAMETER ( ONE = 1.0e+0, zero = 0.0e+0 )
158 COMPLEX CZERO
159 parameter( czero = ( 0.0e+0, 0.0e+0 ) )
160* ..
161* .. Local Scalars ..
162 LOGICAL UPPER
163 INTEGER I, KASE
164 REAL AINVNM
165* ..
166* .. Local Arrays ..
167 INTEGER ISAVE( 3 )
168* ..
169* .. External Functions ..
170 LOGICAL LSAME
171 EXTERNAL LSAME
172* ..
173* .. External Subroutines ..
174 EXTERNAL clacn2, csytrs_rook, xerbla
175* ..
176* .. Intrinsic Functions ..
177 INTRINSIC max
178* ..
179* .. Executable Statements ..
180*
181* Test the input parameters.
182*
183 info = 0
184 upper = lsame( uplo, 'U' )
185 IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
186 info = -1
187 ELSE IF( n.LT.0 ) THEN
188 info = -2
189 ELSE IF( lda.LT.max( 1, n ) ) THEN
190 info = -4
191 ELSE IF( anorm.LT.zero ) THEN
192 info = -6
193 END IF
194 IF( info.NE.0 ) THEN
195 CALL xerbla( 'CSYCON_ROOK', -info )
196 RETURN
197 END IF
198*
199* Quick return if possible
200*
201 rcond = zero
202 IF( n.EQ.0 ) THEN
203 rcond = one
204 RETURN
205 ELSE IF( anorm.LE.zero ) THEN
206 RETURN
207 END IF
208*
209* Check that the diagonal matrix D is nonsingular.
210*
211 IF( upper ) THEN
212*
213* Upper triangular storage: examine D from bottom to top
214*
215 DO 10 i = n, 1, -1
216 IF( ipiv( i ).GT.0 .AND. a( i, i ).EQ.czero )
217 $ RETURN
218 10 CONTINUE
219 ELSE
220*
221* Lower triangular storage: examine D from top to bottom.
222*
223 DO 20 i = 1, n
224 IF( ipiv( i ).GT.0 .AND. a( i, i ).EQ.czero )
225 $ RETURN
226 20 CONTINUE
227 END IF
228*
229* Estimate the 1-norm of the inverse.
230*
231 kase = 0
232 30 CONTINUE
233 CALL clacn2( n, work( n+1 ), work, ainvnm, kase, isave )
234 IF( kase.NE.0 ) THEN
235*
236* Multiply by inv(L*D*L**T) or inv(U*D*U**T).
237*
238 CALL csytrs_rook( uplo, n, 1, a, lda, ipiv, work, n, info )
239 GO TO 30
240 END IF
241*
242* Compute the estimate of the reciprocal condition number.
243*
244 IF( ainvnm.NE.zero )
245 $ rcond = ( one / ainvnm ) / anorm
246*
247 RETURN
248*
249* End of CSYCON_ROOK
250*
251 END
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine csycon_rook(uplo, n, a, lda, ipiv, anorm, rcond, work, info)
CSYCON_ROOK
subroutine csytrs_rook(uplo, n, nrhs, a, lda, ipiv, b, ldb, info)
CSYTRS_ROOK
subroutine clacn2(n, v, x, est, kase, isave)
CLACN2 estimates the 1-norm of a square matrix, using reverse communication for evaluating matrix-vec...
Definition clacn2.f:131