LAPACK 3.11.0 LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
dtpcon.f
Go to the documentation of this file.
1*> \brief \b DTPCON
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> \htmlonly
9*> Download DTPCON + dependencies
10*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dtpcon.f">
11*> [TGZ]</a>
12*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dtpcon.f">
13*> [ZIP]</a>
14*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dtpcon.f">
15*> [TXT]</a>
16*> \endhtmlonly
17*
18* Definition:
19* ===========
20*
21* SUBROUTINE DTPCON( NORM, UPLO, DIAG, N, AP, RCOND, WORK, IWORK,
22* INFO )
23*
24* .. Scalar Arguments ..
25* CHARACTER DIAG, NORM, UPLO
26* INTEGER INFO, N
27* DOUBLE PRECISION RCOND
28* ..
29* .. Array Arguments ..
30* INTEGER IWORK( * )
31* DOUBLE PRECISION AP( * ), WORK( * )
32* ..
33*
34*
35*> \par Purpose:
36* =============
37*>
38*> \verbatim
39*>
40*> DTPCON estimates the reciprocal of the condition number of a packed
41*> triangular matrix A, in either the 1-norm or the infinity-norm.
42*>
43*> The norm of A is computed and an estimate is obtained for
44*> norm(inv(A)), then the reciprocal of the condition number is
45*> computed as
46*> RCOND = 1 / ( norm(A) * norm(inv(A)) ).
47*> \endverbatim
48*
49* Arguments:
50* ==========
51*
52*> \param[in] NORM
53*> \verbatim
54*> NORM is CHARACTER*1
55*> Specifies whether the 1-norm condition number or the
56*> infinity-norm condition number is required:
57*> = '1' or 'O': 1-norm;
58*> = 'I': Infinity-norm.
59*> \endverbatim
60*>
61*> \param[in] UPLO
62*> \verbatim
63*> UPLO is CHARACTER*1
64*> = 'U': A is upper triangular;
65*> = 'L': A is lower triangular.
66*> \endverbatim
67*>
68*> \param[in] DIAG
69*> \verbatim
70*> DIAG is CHARACTER*1
71*> = 'N': A is non-unit triangular;
72*> = 'U': A is unit triangular.
73*> \endverbatim
74*>
75*> \param[in] N
76*> \verbatim
77*> N is INTEGER
78*> The order of the matrix A. N >= 0.
79*> \endverbatim
80*>
81*> \param[in] AP
82*> \verbatim
83*> AP is DOUBLE PRECISION array, dimension (N*(N+1)/2)
84*> The upper or lower triangular matrix A, packed columnwise in
85*> a linear array. The j-th column of A is stored in the array
86*> AP as follows:
87*> if UPLO = 'U', AP(i + (j-1)*j/2) = A(i,j) for 1<=i<=j;
88*> if UPLO = 'L', AP(i + (j-1)*(2n-j)/2) = A(i,j) for j<=i<=n.
89*> If DIAG = 'U', the diagonal elements of A are not referenced
90*> and are assumed to be 1.
91*> \endverbatim
92*>
93*> \param[out] RCOND
94*> \verbatim
95*> RCOND is DOUBLE PRECISION
96*> The reciprocal of the condition number of the matrix A,
97*> computed as RCOND = 1/(norm(A) * norm(inv(A))).
98*> \endverbatim
99*>
100*> \param[out] WORK
101*> \verbatim
102*> WORK is DOUBLE PRECISION array, dimension (3*N)
103*> \endverbatim
104*>
105*> \param[out] IWORK
106*> \verbatim
107*> IWORK is INTEGER array, dimension (N)
108*> \endverbatim
109*>
110*> \param[out] INFO
111*> \verbatim
112*> INFO is INTEGER
113*> = 0: successful exit
114*> < 0: if INFO = -i, the i-th argument had an illegal value
115*> \endverbatim
116*
117* Authors:
118* ========
119*
120*> \author Univ. of Tennessee
121*> \author Univ. of California Berkeley
122*> \author Univ. of Colorado Denver
123*> \author NAG Ltd.
124*
125*> \ingroup doubleOTHERcomputational
126*
127* =====================================================================
128 SUBROUTINE dtpcon( NORM, UPLO, DIAG, N, AP, RCOND, WORK, IWORK,
129 \$ INFO )
130*
131* -- LAPACK computational routine --
132* -- LAPACK is a software package provided by Univ. of Tennessee, --
133* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
134*
135* .. Scalar Arguments ..
136 CHARACTER DIAG, NORM, UPLO
137 INTEGER INFO, N
138 DOUBLE PRECISION RCOND
139* ..
140* .. Array Arguments ..
141 INTEGER IWORK( * )
142 DOUBLE PRECISION AP( * ), WORK( * )
143* ..
144*
145* =====================================================================
146*
147* .. Parameters ..
148 DOUBLE PRECISION ONE, ZERO
149 parameter( one = 1.0d+0, zero = 0.0d+0 )
150* ..
151* .. Local Scalars ..
152 LOGICAL NOUNIT, ONENRM, UPPER
153 CHARACTER NORMIN
154 INTEGER IX, KASE, KASE1
155 DOUBLE PRECISION AINVNM, ANORM, SCALE, SMLNUM, XNORM
156* ..
157* .. Local Arrays ..
158 INTEGER ISAVE( 3 )
159* ..
160* .. External Functions ..
161 LOGICAL LSAME
162 INTEGER IDAMAX
163 DOUBLE PRECISION DLAMCH, DLANTP
164 EXTERNAL lsame, idamax, dlamch, dlantp
165* ..
166* .. External Subroutines ..
167 EXTERNAL dlacn2, dlatps, drscl, xerbla
168* ..
169* .. Intrinsic Functions ..
170 INTRINSIC abs, dble, max
171* ..
172* .. Executable Statements ..
173*
174* Test the input parameters.
175*
176 info = 0
177 upper = lsame( uplo, 'U' )
178 onenrm = norm.EQ.'1' .OR. lsame( norm, 'O' )
179 nounit = lsame( diag, 'N' )
180*
181 IF( .NOT.onenrm .AND. .NOT.lsame( norm, 'I' ) ) THEN
182 info = -1
183 ELSE IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
184 info = -2
185 ELSE IF( .NOT.nounit .AND. .NOT.lsame( diag, 'U' ) ) THEN
186 info = -3
187 ELSE IF( n.LT.0 ) THEN
188 info = -4
189 END IF
190 IF( info.NE.0 ) THEN
191 CALL xerbla( 'DTPCON', -info )
192 RETURN
193 END IF
194*
195* Quick return if possible
196*
197 IF( n.EQ.0 ) THEN
198 rcond = one
199 RETURN
200 END IF
201*
202 rcond = zero
203 smlnum = dlamch( 'Safe minimum' )*dble( max( 1, n ) )
204*
205* Compute the norm of the triangular matrix A.
206*
207 anorm = dlantp( norm, uplo, diag, n, ap, work )
208*
209* Continue only if ANORM > 0.
210*
211 IF( anorm.GT.zero ) THEN
212*
213* Estimate the norm of the inverse of A.
214*
215 ainvnm = zero
216 normin = 'N'
217 IF( onenrm ) THEN
218 kase1 = 1
219 ELSE
220 kase1 = 2
221 END IF
222 kase = 0
223 10 CONTINUE
224 CALL dlacn2( n, work( n+1 ), work, iwork, ainvnm, kase, isave )
225 IF( kase.NE.0 ) THEN
226 IF( kase.EQ.kase1 ) THEN
227*
228* Multiply by inv(A).
229*
230 CALL dlatps( uplo, 'No transpose', diag, normin, n, ap,
231 \$ work, scale, work( 2*n+1 ), info )
232 ELSE
233*
234* Multiply by inv(A**T).
235*
236 CALL dlatps( uplo, 'Transpose', diag, normin, n, ap,
237 \$ work, scale, work( 2*n+1 ), info )
238 END IF
239 normin = 'Y'
240*
241* Multiply by 1/SCALE if doing so will not cause overflow.
242*
243 IF( scale.NE.one ) THEN
244 ix = idamax( n, work, 1 )
245 xnorm = abs( work( ix ) )
246 IF( scale.LT.xnorm*smlnum .OR. scale.EQ.zero )
247 \$ GO TO 20
248 CALL drscl( n, scale, work, 1 )
249 END IF
250 GO TO 10
251 END IF
252*
253* Compute the estimate of the reciprocal condition number.
254*
255 IF( ainvnm.NE.zero )
256 \$ rcond = ( one / anorm ) / ainvnm
257 END IF
258*
259 20 CONTINUE
260 RETURN
261*
262* End of DTPCON
263*
264 END
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:60
subroutine drscl(N, SA, SX, INCX)
DRSCL multiplies a vector by the reciprocal of a real scalar.
Definition: drscl.f:84
subroutine dlatps(UPLO, TRANS, DIAG, NORMIN, N, AP, X, SCALE, CNORM, INFO)
DLATPS solves a triangular system of equations with the matrix held in packed storage.
Definition: dlatps.f:229
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:136
subroutine dtpcon(NORM, UPLO, DIAG, N, AP, RCOND, WORK, IWORK, INFO)
DTPCON
Definition: dtpcon.f:130