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