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

◆ dspcon()

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

DSPCON

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

Purpose:
 DSPCON estimates the reciprocal of the condition number (in the
 1-norm) of a real symmetric packed matrix A using the factorization
 A = U*D*U**T or A = L*D*L**T computed by DSPTRF.

 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
          Specifies whether the details of the factorization are stored
          as an upper or lower triangular matrix.
          = 'U':  Upper triangular, form is A = U*D*U**T;
          = 'L':  Lower triangular, form is A = L*D*L**T.
[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 block diagonal matrix D and the multipliers used to
          obtain the factor U or L as computed by DSPTRF, stored as a
          packed triangular matrix.
[in]IPIV
          IPIV is INTEGER array, dimension (N)
          Details of the interchanges and the block structure of D
          as determined by DSPTRF.
[in]ANORM
          ANORM is DOUBLE PRECISION
          The 1-norm of the original 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 (2*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 123 of file dspcon.f.

125*
126* -- LAPACK computational routine --
127* -- LAPACK is a software package provided by Univ. of Tennessee, --
128* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
129*
130* .. Scalar Arguments ..
131 CHARACTER UPLO
132 INTEGER INFO, N
133 DOUBLE PRECISION ANORM, RCOND
134* ..
135* .. Array Arguments ..
136 INTEGER IPIV( * ), IWORK( * )
137 DOUBLE PRECISION AP( * ), WORK( * )
138* ..
139*
140* =====================================================================
141*
142* .. Parameters ..
143 DOUBLE PRECISION ONE, ZERO
144 parameter( one = 1.0d+0, zero = 0.0d+0 )
145* ..
146* .. Local Scalars ..
147 LOGICAL UPPER
148 INTEGER I, IP, KASE
149 DOUBLE PRECISION AINVNM
150* ..
151* .. Local Arrays ..
152 INTEGER ISAVE( 3 )
153* ..
154* .. External Functions ..
155 LOGICAL LSAME
156 EXTERNAL lsame
157* ..
158* .. External Subroutines ..
159 EXTERNAL dlacn2, dsptrs, xerbla
160* ..
161* .. Executable Statements ..
162*
163* Test the input parameters.
164*
165 info = 0
166 upper = lsame( uplo, 'U' )
167 IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
168 info = -1
169 ELSE IF( n.LT.0 ) THEN
170 info = -2
171 ELSE IF( anorm.LT.zero ) THEN
172 info = -5
173 END IF
174 IF( info.NE.0 ) THEN
175 CALL xerbla( 'DSPCON', -info )
176 RETURN
177 END IF
178*
179* Quick return if possible
180*
181 rcond = zero
182 IF( n.EQ.0 ) THEN
183 rcond = one
184 RETURN
185 ELSE IF( anorm.LE.zero ) THEN
186 RETURN
187 END IF
188*
189* Check that the diagonal matrix D is nonsingular.
190*
191 IF( upper ) THEN
192*
193* Upper triangular storage: examine D from bottom to top
194*
195 ip = n*( n+1 ) / 2
196 DO 10 i = n, 1, -1
197 IF( ipiv( i ).GT.0 .AND. ap( ip ).EQ.zero )
198 $ RETURN
199 ip = ip - i
200 10 CONTINUE
201 ELSE
202*
203* Lower triangular storage: examine D from top to bottom.
204*
205 ip = 1
206 DO 20 i = 1, n
207 IF( ipiv( i ).GT.0 .AND. ap( ip ).EQ.zero )
208 $ RETURN
209 ip = ip + n - i + 1
210 20 CONTINUE
211 END IF
212*
213* Estimate the 1-norm of the inverse.
214*
215 kase = 0
216 30 CONTINUE
217 CALL dlacn2( n, work( n+1 ), work, iwork, ainvnm, kase, isave )
218 IF( kase.NE.0 ) THEN
219*
220* Multiply by inv(L*D*L**T) or inv(U*D*U**T).
221*
222 CALL dsptrs( uplo, n, 1, ap, ipiv, work, n, info )
223 GO TO 30
224 END IF
225*
226* Compute the estimate of the reciprocal condition number.
227*
228 IF( ainvnm.NE.zero )
229 $ rcond = ( one / ainvnm ) / anorm
230*
231 RETURN
232*
233* End of DSPCON
234*
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine dsptrs(uplo, n, nrhs, ap, ipiv, b, ldb, info)
DSPTRS
Definition dsptrs.f:115
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
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48
Here is the call graph for this function:
Here is the caller graph for this function: