 LAPACK  3.6.1 LAPACK: Linear Algebra PACKage
 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

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```
Date
November 2011

Definition at line 127 of file dspcon.f.

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

Here is the call graph for this function:

Here is the caller graph for this function: