LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
ssycon_rook.f
Go to the documentation of this file.
1*> \brief <b> SSYCON_ROOK </b>
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> Download SSYCON_ROOK + dependencies
9*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/ssycon_rook.f">
10*> [TGZ]</a>
11*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/ssycon_rook.f">
12*> [ZIP]</a>
13*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ssycon_rook.f">
14*> [TXT]</a>
15*
16* Definition:
17* ===========
18*
19* SUBROUTINE SSYCON_ROOK( UPLO, N, A, LDA, IPIV, ANORM, RCOND,
20* WORK, IWORK, INFO )
21*
22* .. Scalar Arguments ..
23* CHARACTER UPLO
24* INTEGER INFO, LDA, N
25* REAL ANORM, RCOND
26* ..
27* .. Array Arguments ..
28* INTEGER IPIV( * ), IWORK( * )
29* REAL A( LDA, * ), WORK( * )
30* ..
31*
32*
33*> \par Purpose:
34* =============
35*>
36*> \verbatim
37*>
38*> SSYCON_ROOK estimates the reciprocal of the condition number (in the
39*> 1-norm) of a real symmetric matrix A using the factorization
40*> A = U*D*U**T or A = L*D*L**T computed by SSYTRF_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 REAL 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 SSYTRF_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 SSYTRF_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 REAL array, dimension (2*N)
101*> \endverbatim
102*>
103*> \param[out] IWORK
104*> \verbatim
105*> IWORK is INTEGER array, dimension (N)
106*> \endverbatim
107*>
108*> \param[out] INFO
109*> \verbatim
110*> INFO is INTEGER
111*> = 0: successful exit
112*> < 0: if INFO = -i, the i-th argument had an illegal value
113*> \endverbatim
114*
115* Authors:
116* ========
117*
118*> \author Univ. of Tennessee
119*> \author Univ. of California Berkeley
120*> \author Univ. of Colorado Denver
121*> \author NAG Ltd.
122*
123*> \ingroup hecon_rook
124*
125*> \par Contributors:
126* ==================
127*> \verbatim
128*>
129*> December 2016, Igor Kozachenko,
130*> Computer Science Division,
131*> University of California, Berkeley
132*>
133*> September 2007, Sven Hammarling, Nicholas J. Higham, Craig Lucas,
134*> School of Mathematics,
135*> University of Manchester
136*>
137*> \endverbatim
138*
139* =====================================================================
140 SUBROUTINE ssycon_rook( UPLO, N, A, LDA, IPIV, ANORM, RCOND,
141 $ WORK,
142 $ IWORK, INFO )
143*
144* -- LAPACK computational routine --
145* -- LAPACK is a software package provided by Univ. of Tennessee, --
146* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
147*
148* .. Scalar Arguments ..
149 CHARACTER UPLO
150 INTEGER INFO, LDA, N
151 REAL ANORM, RCOND
152* ..
153* .. Array Arguments ..
154 INTEGER IPIV( * ), IWORK( * )
155 REAL A( LDA, * ), WORK( * )
156* ..
157*
158* =====================================================================
159*
160* .. Parameters ..
161 REAL ONE, ZERO
162 PARAMETER ( ONE = 1.0e+0, zero = 0.0e+0 )
163* ..
164* .. Local Scalars ..
165 LOGICAL UPPER
166 INTEGER I, KASE
167 REAL AINVNM
168* ..
169* .. Local Arrays ..
170 INTEGER ISAVE( 3 )
171* ..
172* .. External Functions ..
173 LOGICAL LSAME
174 EXTERNAL LSAME
175* ..
176* .. External Subroutines ..
177 EXTERNAL slacn2, ssytrs_rook, xerbla
178* ..
179* .. Intrinsic Functions ..
180 INTRINSIC max
181* ..
182* .. Executable Statements ..
183*
184* Test the input parameters.
185*
186 info = 0
187 upper = lsame( uplo, 'U' )
188 IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
189 info = -1
190 ELSE IF( n.LT.0 ) THEN
191 info = -2
192 ELSE IF( lda.LT.max( 1, n ) ) THEN
193 info = -4
194 ELSE IF( anorm.LT.zero ) THEN
195 info = -6
196 END IF
197 IF( info.NE.0 ) THEN
198 CALL xerbla( 'SSYCON_ROOK', -info )
199 RETURN
200 END IF
201*
202* Quick return if possible
203*
204 rcond = zero
205 IF( n.EQ.0 ) THEN
206 rcond = one
207 RETURN
208 ELSE IF( anorm.LE.zero ) THEN
209 RETURN
210 END IF
211*
212* Check that the diagonal matrix D is nonsingular.
213*
214 IF( upper ) THEN
215*
216* Upper triangular storage: examine D from bottom to top
217*
218 DO 10 i = n, 1, -1
219 IF( ipiv( i ).GT.0 .AND. a( i, i ).EQ.zero )
220 $ RETURN
221 10 CONTINUE
222 ELSE
223*
224* Lower triangular storage: examine D from top to bottom.
225*
226 DO 20 i = 1, n
227 IF( ipiv( i ).GT.0 .AND. a( i, i ).EQ.zero )
228 $ RETURN
229 20 CONTINUE
230 END IF
231*
232* Estimate the 1-norm of the inverse.
233*
234 kase = 0
235 30 CONTINUE
236 CALL slacn2( n, work( n+1 ), work, iwork, ainvnm, kase, isave )
237 IF( kase.NE.0 ) THEN
238*
239* Multiply by inv(L*D*L**T) or inv(U*D*U**T).
240*
241 CALL ssytrs_rook( uplo, n, 1, a, lda, ipiv, work, n, info )
242 GO TO 30
243 END IF
244*
245* Compute the estimate of the reciprocal condition number.
246*
247 IF( ainvnm.NE.zero )
248 $ rcond = ( one / ainvnm ) / anorm
249*
250 RETURN
251*
252* End of SSYCON_ROOK
253*
254 END
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine ssycon_rook(uplo, n, a, lda, ipiv, anorm, rcond, work, iwork, info)
SSYCON_ROOK
subroutine ssytrs_rook(uplo, n, nrhs, a, lda, ipiv, b, ldb, info)
SSYTRS_ROOK
subroutine slacn2(n, v, x, isgn, est, kase, isave)
SLACN2 estimates the 1-norm of a square matrix, using reverse communication for evaluating matrix-vec...
Definition slacn2.f:134