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

◆ sspcon()

subroutine sspcon ( character uplo,
integer n,
real, dimension( * ) ap,
integer, dimension( * ) ipiv,
real anorm,
real rcond,
real, dimension( * ) work,
integer, dimension( * ) iwork,
integer info )

SSPCON

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

Purpose:
!>
!> SSPCON 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 SSPTRF.
!>
!> 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 REAL 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 SSPTRF, 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 SSPTRF.
!> 
[in]ANORM
!>          ANORM is REAL
!>          The 1-norm of the original matrix A.
!> 
[out]RCOND
!>          RCOND is REAL
!>          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 REAL 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 121 of file sspcon.f.

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 REAL ANORM, RCOND
133* ..
134* .. Array Arguments ..
135 INTEGER IPIV( * ), IWORK( * )
136 REAL AP( * ), WORK( * )
137* ..
138*
139* =====================================================================
140*
141* .. Parameters ..
142 REAL ONE, ZERO
143 parameter( one = 1.0e+0, zero = 0.0e+0 )
144* ..
145* .. Local Scalars ..
146 LOGICAL UPPER
147 INTEGER I, IP, KASE
148 REAL 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 slacn2, ssptrs, 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( 'SSPCON', -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 slacn2( 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 ssptrs( 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 SSPCON
233*
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine ssptrs(uplo, n, nrhs, ap, ipiv, b, ldb, info)
SSPTRS
Definition ssptrs.f:113
subroutine slacn2(n, v, x, isgn, est, kase, isave)
SLACN2 estimates the 1-norm of a square matrix, using reverse communication for evaluating matrix-vec...
Definition slacn2.f:134
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: