LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
ssycon.f
Go to the documentation of this file.
1*> \brief \b SSYCON
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> Download SSYCON + dependencies
9*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/ssycon.f">
10*> [TGZ]</a>
11*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/ssycon.f">
12*> [ZIP]</a>
13*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ssycon.f">
14*> [TXT]</a>
15*
16* Definition:
17* ===========
18*
19* SUBROUTINE SSYCON( UPLO, N, A, LDA, IPIV, ANORM, RCOND, WORK,
20* 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 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.
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.
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.
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
124*
125* =====================================================================
126 SUBROUTINE ssycon( UPLO, N, A, LDA, IPIV, ANORM, RCOND, WORK,
127 $ IWORK, INFO )
128*
129* -- LAPACK computational routine --
130* -- LAPACK is a software package provided by Univ. of Tennessee, --
131* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
132*
133* .. Scalar Arguments ..
134 CHARACTER UPLO
135 INTEGER INFO, LDA, N
136 REAL ANORM, RCOND
137* ..
138* .. Array Arguments ..
139 INTEGER IPIV( * ), IWORK( * )
140 REAL A( LDA, * ), WORK( * )
141* ..
142*
143* =====================================================================
144*
145* .. Parameters ..
146 REAL ONE, ZERO
147 parameter( one = 1.0e+0, zero = 0.0e+0 )
148* ..
149* .. Local Scalars ..
150 LOGICAL UPPER
151 INTEGER I, KASE
152 REAL AINVNM
153* ..
154* .. Local Arrays ..
155 INTEGER ISAVE( 3 )
156* ..
157* .. External Functions ..
158 LOGICAL LSAME
159 EXTERNAL lsame
160* ..
161* .. External Subroutines ..
162 EXTERNAL slacn2, ssytrs, xerbla
163* ..
164* .. Intrinsic Functions ..
165 INTRINSIC max
166* ..
167* .. Executable Statements ..
168*
169* Test the input parameters.
170*
171 info = 0
172 upper = lsame( uplo, 'U' )
173 IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
174 info = -1
175 ELSE IF( n.LT.0 ) THEN
176 info = -2
177 ELSE IF( lda.LT.max( 1, n ) ) THEN
178 info = -4
179 ELSE IF( anorm.LT.zero ) THEN
180 info = -6
181 END IF
182 IF( info.NE.0 ) THEN
183 CALL xerbla( 'SSYCON', -info )
184 RETURN
185 END IF
186*
187* Quick return if possible
188*
189 rcond = zero
190 IF( n.EQ.0 ) THEN
191 rcond = one
192 RETURN
193 ELSE IF( anorm.LE.zero ) THEN
194 RETURN
195 END IF
196*
197* Check that the diagonal matrix D is nonsingular.
198*
199 IF( upper ) THEN
200*
201* Upper triangular storage: examine D from bottom to top
202*
203 DO 10 i = n, 1, -1
204 IF( ipiv( i ).GT.0 .AND. a( i, i ).EQ.zero )
205 $ RETURN
206 10 CONTINUE
207 ELSE
208*
209* Lower triangular storage: examine D from top to bottom.
210*
211 DO 20 i = 1, n
212 IF( ipiv( i ).GT.0 .AND. a( i, i ).EQ.zero )
213 $ RETURN
214 20 CONTINUE
215 END IF
216*
217* Estimate the 1-norm of the inverse.
218*
219 kase = 0
220 30 CONTINUE
221 CALL slacn2( n, work( n+1 ), work, iwork, ainvnm, kase, isave )
222 IF( kase.NE.0 ) THEN
223*
224* Multiply by inv(L*D*L**T) or inv(U*D*U**T).
225*
226 CALL ssytrs( uplo, n, 1, a, lda, ipiv, work, n, info )
227 GO TO 30
228 END IF
229*
230* Compute the estimate of the reciprocal condition number.
231*
232 IF( ainvnm.NE.zero )
233 $ rcond = ( one / ainvnm ) / anorm
234*
235 RETURN
236*
237* End of SSYCON
238*
239 END
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine ssycon(uplo, n, a, lda, ipiv, anorm, rcond, work, iwork, info)
SSYCON
Definition ssycon.f:128
subroutine ssytrs(uplo, n, nrhs, a, lda, ipiv, b, ldb, info)
SSYTRS
Definition ssytrs.f:118
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