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

◆ ssycon()

subroutine ssycon ( character uplo,
integer n,
real, dimension( lda, * ) a,
integer lda,
integer, dimension( * ) ipiv,
real anorm,
real rcond,
real, dimension( * ) work,
integer, dimension( * ) iwork,
integer info )

SSYCON

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

Purpose:
!>
!> SSYCON estimates the reciprocal of the condition number (in the
!> 1-norm) of a real symmetric matrix A using the factorization
!> A = U*D*U**T or A = L*D*L**T computed by SSYTRF.
!>
!> 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]A
!>          A is REAL array, dimension (LDA,N)
!>          The block diagonal matrix D and the multipliers used to
!>          obtain the factor U or L as computed by SSYTRF.
!> 
[in]LDA
!>          LDA is INTEGER
!>          The leading dimension of the array A.  LDA >= max(1,N).
!> 
[in]IPIV
!>          IPIV is INTEGER array, dimension (N)
!>          Details of the interchanges and the block structure of D
!>          as determined by SSYTRF.
!> 
[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 126 of file ssycon.f.

128*
129* -- LAPACK computational routine --
130* -- LAPACK is a software package provided by Univ. of Tennessee, --
131* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
132*
133* .. Scalar Arguments ..
134 CHARACTER UPLO
135 INTEGER INFO, LDA, N
136 REAL ANORM, RCOND
137* ..
138* .. Array Arguments ..
139 INTEGER IPIV( * ), IWORK( * )
140 REAL A( LDA, * ), WORK( * )
141* ..
142*
143* =====================================================================
144*
145* .. Parameters ..
146 REAL ONE, ZERO
147 parameter( one = 1.0e+0, zero = 0.0e+0 )
148* ..
149* .. Local Scalars ..
150 LOGICAL UPPER
151 INTEGER I, KASE
152 REAL 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 slacn2, ssytrs, xerbla
163* ..
164* .. Intrinsic Functions ..
165 INTRINSIC max
166* ..
167* .. Executable Statements ..
168*
169* Test the input parameters.
170*
171 info = 0
172 upper = lsame( uplo, 'U' )
173 IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
174 info = -1
175 ELSE IF( n.LT.0 ) THEN
176 info = -2
177 ELSE IF( lda.LT.max( 1, n ) ) THEN
178 info = -4
179 ELSE IF( anorm.LT.zero ) THEN
180 info = -6
181 END IF
182 IF( info.NE.0 ) THEN
183 CALL xerbla( 'SSYCON', -info )
184 RETURN
185 END IF
186*
187* Quick return if possible
188*
189 rcond = zero
190 IF( n.EQ.0 ) THEN
191 rcond = one
192 RETURN
193 ELSE IF( anorm.LE.zero ) THEN
194 RETURN
195 END IF
196*
197* Check that the diagonal matrix D is nonsingular.
198*
199 IF( upper ) THEN
200*
201* Upper triangular storage: examine D from bottom to top
202*
203 DO 10 i = n, 1, -1
204 IF( ipiv( i ).GT.0 .AND. a( i, i ).EQ.zero )
205 $ RETURN
206 10 CONTINUE
207 ELSE
208*
209* Lower triangular storage: examine D from top to bottom.
210*
211 DO 20 i = 1, n
212 IF( ipiv( i ).GT.0 .AND. a( i, i ).EQ.zero )
213 $ RETURN
214 20 CONTINUE
215 END IF
216*
217* Estimate the 1-norm of the inverse.
218*
219 kase = 0
220 30 CONTINUE
221 CALL slacn2( n, work( n+1 ), work, iwork, ainvnm, kase, isave )
222 IF( kase.NE.0 ) THEN
223*
224* Multiply by inv(L*D*L**T) or inv(U*D*U**T).
225*
226 CALL ssytrs( uplo, n, 1, a, lda, ipiv, work, n, info )
227 GO TO 30
228 END IF
229*
230* Compute the estimate of the reciprocal condition number.
231*
232 IF( ainvnm.NE.zero )
233 $ rcond = ( one / ainvnm ) / anorm
234*
235 RETURN
236*
237* End of SSYCON
238*
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine ssytrs(uplo, n, nrhs, a, lda, ipiv, b, ldb, info)
SSYTRS
Definition ssytrs.f:118
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: