LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ dppcon()

subroutine dppcon ( character uplo,
integer n,
double precision, dimension( * ) ap,
double precision anorm,
double precision rcond,
double precision, dimension( * ) work,
integer, dimension( * ) iwork,
integer info )

DPPCON

Download DPPCON + dependencies [TGZ] [ZIP] [TXT]

Purpose:
!>
!> DPPCON estimates the reciprocal of the condition number (in the
!> 1-norm) of a real symmetric positive definite packed matrix using
!> the Cholesky factorization A = U**T*U or A = L*L**T computed by
!> DPPTRF.
!>
!> An estimate is obtained for norm(inv(A)), and the reciprocal of the
!> condition number is computed as RCOND = 1 / (ANORM * norm(inv(A))).
!> 
Parameters
[in]UPLO
!>          UPLO is CHARACTER*1
!>          = 'U':  Upper triangle of A is stored;
!>          = 'L':  Lower triangle of A is stored.
!> 
[in]N
!>          N is INTEGER
!>          The order of the matrix A.  N >= 0.
!> 
[in]AP
!>          AP is DOUBLE PRECISION array, dimension (N*(N+1)/2)
!>          The triangular factor U or L from the Cholesky factorization
!>          A = U**T*U or A = L*L**T, packed columnwise in a linear
!>          array.  The j-th column of U or L is stored in the array AP
!>          as follows:
!>          if UPLO = 'U', AP(i + (j-1)*j/2) = U(i,j) for 1<=i<=j;
!>          if UPLO = 'L', AP(i + (j-1)*(2n-j)/2) = L(i,j) for j<=i<=n.
!> 
[in]ANORM
!>          ANORM is DOUBLE PRECISION
!>          The 1-norm (or infinity-norm) of the symmetric matrix A.
!> 
[out]RCOND
!>          RCOND is DOUBLE PRECISION
!>          The reciprocal of the condition number of the matrix A,
!>          computed as RCOND = 1/(ANORM * AINVNM), where AINVNM is an
!>          estimate of the 1-norm of inv(A) computed in this routine.
!> 
[out]WORK
!>          WORK is DOUBLE PRECISION array, dimension (3*N)
!> 
[out]IWORK
!>          IWORK is INTEGER array, dimension (N)
!> 
[out]INFO
!>          INFO is INTEGER
!>          = 0:  successful exit
!>          < 0:  if INFO = -i, the i-th argument had an illegal value
!> 
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 115 of file dppcon.f.

117*
118* -- LAPACK computational routine --
119* -- LAPACK is a software package provided by Univ. of Tennessee, --
120* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
121*
122* .. Scalar Arguments ..
123 CHARACTER UPLO
124 INTEGER INFO, N
125 DOUBLE PRECISION ANORM, RCOND
126* ..
127* .. Array Arguments ..
128 INTEGER IWORK( * )
129 DOUBLE PRECISION AP( * ), WORK( * )
130* ..
131*
132* =====================================================================
133*
134* .. Parameters ..
135 DOUBLE PRECISION ONE, ZERO
136 parameter( one = 1.0d+0, zero = 0.0d+0 )
137* ..
138* .. Local Scalars ..
139 LOGICAL UPPER
140 CHARACTER NORMIN
141 INTEGER IX, KASE
142 DOUBLE PRECISION AINVNM, SCALE, SCALEL, SCALEU, SMLNUM
143* ..
144* .. Local Arrays ..
145 INTEGER ISAVE( 3 )
146* ..
147* .. External Functions ..
148 LOGICAL LSAME
149 INTEGER IDAMAX
150 DOUBLE PRECISION DLAMCH
151 EXTERNAL lsame, idamax, dlamch
152* ..
153* .. External Subroutines ..
154 EXTERNAL dlacn2, dlatps, drscl, xerbla
155* ..
156* .. Intrinsic Functions ..
157 INTRINSIC abs
158* ..
159* .. Executable Statements ..
160*
161* Test the input parameters.
162*
163 info = 0
164 upper = lsame( uplo, 'U' )
165 IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
166 info = -1
167 ELSE IF( n.LT.0 ) THEN
168 info = -2
169 ELSE IF( anorm.LT.zero ) THEN
170 info = -4
171 END IF
172 IF( info.NE.0 ) THEN
173 CALL xerbla( 'DPPCON', -info )
174 RETURN
175 END IF
176*
177* Quick return if possible
178*
179 rcond = zero
180 IF( n.EQ.0 ) THEN
181 rcond = one
182 RETURN
183 ELSE IF( anorm.EQ.zero ) THEN
184 RETURN
185 END IF
186*
187 smlnum = dlamch( 'Safe minimum' )
188*
189* Estimate the 1-norm of the inverse.
190*
191 kase = 0
192 normin = 'N'
193 10 CONTINUE
194 CALL dlacn2( n, work( n+1 ), work, iwork, ainvnm, kase, isave )
195 IF( kase.NE.0 ) THEN
196 IF( upper ) THEN
197*
198* Multiply by inv(U**T).
199*
200 CALL dlatps( 'Upper', 'Transpose', 'Non-unit', normin, n,
201 $ ap, work, scalel, work( 2*n+1 ), info )
202 normin = 'Y'
203*
204* Multiply by inv(U).
205*
206 CALL dlatps( 'Upper', 'No transpose', 'Non-unit', normin,
207 $ n,
208 $ ap, work, scaleu, work( 2*n+1 ), info )
209 ELSE
210*
211* Multiply by inv(L).
212*
213 CALL dlatps( 'Lower', 'No transpose', 'Non-unit', normin,
214 $ n,
215 $ ap, work, scalel, work( 2*n+1 ), info )
216 normin = 'Y'
217*
218* Multiply by inv(L**T).
219*
220 CALL dlatps( 'Lower', 'Transpose', 'Non-unit', normin, n,
221 $ ap, work, scaleu, work( 2*n+1 ), info )
222 END IF
223*
224* Multiply by 1/SCALE if doing so will not cause overflow.
225*
226 scale = scalel*scaleu
227 IF( scale.NE.one ) THEN
228 ix = idamax( n, work, 1 )
229 IF( scale.LT.abs( work( ix ) )*smlnum .OR. scale.EQ.zero )
230 $ GO TO 20
231 CALL drscl( n, scale, work, 1 )
232 END IF
233 GO TO 10
234 END IF
235*
236* Compute the estimate of the reciprocal condition number.
237*
238 IF( ainvnm.NE.zero )
239 $ rcond = ( one / ainvnm ) / anorm
240*
241 20 CONTINUE
242 RETURN
243*
244* End of DPPCON
245*
subroutine xerbla(srname, info)
Definition cblat2.f:3285
integer function idamax(n, dx, incx)
IDAMAX
Definition idamax.f:71
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
double precision function dlamch(cmach)
DLAMCH
Definition dlamch.f:69
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:227
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48
subroutine drscl(n, sa, sx, incx)
DRSCL multiplies a vector by the reciprocal of a real scalar.
Definition drscl.f:82
Here is the call graph for this function:
Here is the caller graph for this function: