LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
dspcon.f
Go to the documentation of this file.
1*> \brief \b DSPCON
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> Download DSPCON + dependencies
9*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dspcon.f">
10*> [TGZ]</a>
11*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dspcon.f">
12*> [ZIP]</a>
13*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dspcon.f">
14*> [TXT]</a>
15*
16* Definition:
17* ===========
18*
19* SUBROUTINE DSPCON( UPLO, N, AP, IPIV, ANORM, RCOND, WORK, IWORK,
20* INFO )
21*
22* .. Scalar Arguments ..
23* CHARACTER UPLO
24* INTEGER INFO, N
25* DOUBLE PRECISION ANORM, RCOND
26* ..
27* .. Array Arguments ..
28* INTEGER IPIV( * ), IWORK( * )
29* DOUBLE PRECISION AP( * ), WORK( * )
30* ..
31*
32*
33*> \par Purpose:
34* =============
35*>
36*> \verbatim
37*>
38*> DSPCON estimates the reciprocal of the condition number (in the
39*> 1-norm) of a real symmetric packed matrix A using the factorization
40*> A = U*D*U**T or A = L*D*L**T computed by DSPTRF.
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] AP
65*> \verbatim
66*> AP is DOUBLE PRECISION array, dimension (N*(N+1)/2)
67*> The block diagonal matrix D and the multipliers used to
68*> obtain the factor U or L as computed by DSPTRF, stored as a
69*> packed triangular matrix.
70*> \endverbatim
71*>
72*> \param[in] IPIV
73*> \verbatim
74*> IPIV is INTEGER array, dimension (N)
75*> Details of the interchanges and the block structure of D
76*> as determined by DSPTRF.
77*> \endverbatim
78*>
79*> \param[in] ANORM
80*> \verbatim
81*> ANORM is DOUBLE PRECISION
82*> The 1-norm of the original matrix A.
83*> \endverbatim
84*>
85*> \param[out] RCOND
86*> \verbatim
87*> RCOND is DOUBLE PRECISION
88*> The reciprocal of the condition number of the matrix A,
89*> computed as RCOND = 1/(ANORM * AINVNM), where AINVNM is an
90*> estimate of the 1-norm of inv(A) computed in this routine.
91*> \endverbatim
92*>
93*> \param[out] WORK
94*> \verbatim
95*> WORK is DOUBLE PRECISION array, dimension (2*N)
96*> \endverbatim
97*>
98*> \param[out] IWORK
99*> \verbatim
100*> IWORK is INTEGER array, dimension (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 hpcon
119*
120* =====================================================================
121 SUBROUTINE dspcon( UPLO, N, AP, IPIV, ANORM, RCOND, WORK,
122 $ IWORK,
123 $ INFO )
124*
125* -- LAPACK computational routine --
126* -- LAPACK is a software package provided by Univ. of Tennessee, --
127* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
128*
129* .. Scalar Arguments ..
130 CHARACTER UPLO
131 INTEGER INFO, N
132 DOUBLE PRECISION ANORM, RCOND
133* ..
134* .. Array Arguments ..
135 INTEGER IPIV( * ), IWORK( * )
136 DOUBLE PRECISION AP( * ), WORK( * )
137* ..
138*
139* =====================================================================
140*
141* .. Parameters ..
142 DOUBLE PRECISION ONE, ZERO
143 PARAMETER ( ONE = 1.0d+0, zero = 0.0d+0 )
144* ..
145* .. Local Scalars ..
146 LOGICAL UPPER
147 INTEGER I, IP, KASE
148 DOUBLE PRECISION AINVNM
149* ..
150* .. Local Arrays ..
151 INTEGER ISAVE( 3 )
152* ..
153* .. External Functions ..
154 LOGICAL LSAME
155 EXTERNAL LSAME
156* ..
157* .. External Subroutines ..
158 EXTERNAL dlacn2, dsptrs, xerbla
159* ..
160* .. Executable Statements ..
161*
162* Test the input parameters.
163*
164 info = 0
165 upper = lsame( uplo, 'U' )
166 IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
167 info = -1
168 ELSE IF( n.LT.0 ) THEN
169 info = -2
170 ELSE IF( anorm.LT.zero ) THEN
171 info = -5
172 END IF
173 IF( info.NE.0 ) THEN
174 CALL xerbla( 'DSPCON', -info )
175 RETURN
176 END IF
177*
178* Quick return if possible
179*
180 rcond = zero
181 IF( n.EQ.0 ) THEN
182 rcond = one
183 RETURN
184 ELSE IF( anorm.LE.zero ) THEN
185 RETURN
186 END IF
187*
188* Check that the diagonal matrix D is nonsingular.
189*
190 IF( upper ) THEN
191*
192* Upper triangular storage: examine D from bottom to top
193*
194 ip = n*( n+1 ) / 2
195 DO 10 i = n, 1, -1
196 IF( ipiv( i ).GT.0 .AND. ap( ip ).EQ.zero )
197 $ RETURN
198 ip = ip - i
199 10 CONTINUE
200 ELSE
201*
202* Lower triangular storage: examine D from top to bottom.
203*
204 ip = 1
205 DO 20 i = 1, n
206 IF( ipiv( i ).GT.0 .AND. ap( ip ).EQ.zero )
207 $ RETURN
208 ip = ip + n - i + 1
209 20 CONTINUE
210 END IF
211*
212* Estimate the 1-norm of the inverse.
213*
214 kase = 0
215 30 CONTINUE
216 CALL dlacn2( n, work( n+1 ), work, iwork, ainvnm, kase, isave )
217 IF( kase.NE.0 ) THEN
218*
219* Multiply by inv(L*D*L**T) or inv(U*D*U**T).
220*
221 CALL dsptrs( uplo, n, 1, ap, ipiv, work, n, info )
222 GO TO 30
223 END IF
224*
225* Compute the estimate of the reciprocal condition number.
226*
227 IF( ainvnm.NE.zero )
228 $ rcond = ( one / ainvnm ) / anorm
229*
230 RETURN
231*
232* End of DSPCON
233*
234 END
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine dspcon(uplo, n, ap, ipiv, anorm, rcond, work, iwork, info)
DSPCON
Definition dspcon.f:124
subroutine dsptrs(uplo, n, nrhs, ap, ipiv, b, ldb, info)
DSPTRS
Definition dsptrs.f:113
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