 |
LAPACK
3.9.0
LAPACK: Linear Algebra PACKage
|
◆ stpcon()
subroutine stpcon |
( |
character |
NORM, |
|
|
character |
UPLO, |
|
|
character |
DIAG, |
|
|
integer |
N, |
|
|
real, dimension( * ) |
AP, |
|
|
real |
RCOND, |
|
|
real, dimension( * ) |
WORK, |
|
|
integer, dimension( * ) |
IWORK, |
|
|
integer |
INFO |
|
) |
| |
STPCON
Download STPCON + dependencies
[TGZ]
[ZIP]
[TXT]
- Purpose:
STPCON estimates the reciprocal of the condition number of a packed
triangular matrix A, in either the 1-norm or the infinity-norm.
The norm of A is computed and an estimate is obtained for
norm(inv(A)), then the reciprocal of the condition number is
computed as
RCOND = 1 / ( norm(A) * norm(inv(A)) ).
- Parameters
-
[in] | NORM | NORM is CHARACTER*1
Specifies whether the 1-norm condition number or the
infinity-norm condition number is required:
= '1' or 'O': 1-norm;
= 'I': Infinity-norm. |
[in] | UPLO | UPLO is CHARACTER*1
= 'U': A is upper triangular;
= 'L': A is lower triangular. |
[in] | DIAG | DIAG is CHARACTER*1
= 'N': A is non-unit triangular;
= 'U': A is unit triangular. |
[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 upper or lower triangular matrix A, packed columnwise in
a linear array. The j-th column of A is stored in the array
AP as follows:
if UPLO = 'U', AP(i + (j-1)*j/2) = A(i,j) for 1<=i<=j;
if UPLO = 'L', AP(i + (j-1)*(2n-j)/2) = A(i,j) for j<=i<=n.
If DIAG = 'U', the diagonal elements of A are not referenced
and are assumed to be 1. |
[out] | RCOND | RCOND is REAL
The reciprocal of the condition number of the matrix A,
computed as RCOND = 1/(norm(A) * norm(inv(A))). |
[out] | WORK | WORK is REAL 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.
- Date
- December 2016
Definition at line 132 of file stpcon.f.
139 CHARACTER DIAG, NORM, UPLO
145 REAL AP( * ), WORK( * )
152 parameter( one = 1.0e+0, zero = 0.0e+0 )
155 LOGICAL NOUNIT, ONENRM, UPPER
157 INTEGER IX, KASE, KASE1
158 REAL AINVNM, ANORM, SCALE, SMLNUM, XNORM
173 INTRINSIC abs, max, real
180 upper =
lsame( uplo,
'U' )
181 onenrm = norm.EQ.
'1' .OR.
lsame( norm,
'O' )
182 nounit =
lsame( diag,
'N' )
184 IF( .NOT.onenrm .AND. .NOT.
lsame( norm,
'I' ) )
THEN
186 ELSE IF( .NOT.upper .AND. .NOT.
lsame( uplo,
'L' ) )
THEN
188 ELSE IF( .NOT.nounit .AND. .NOT.
lsame( diag,
'U' ) )
THEN
190 ELSE IF( n.LT.0 )
THEN
194 CALL xerbla(
'STPCON', -info )
206 smlnum =
slamch(
'Safe minimum' )*real( max( 1, n ) )
210 anorm =
slantp( norm, uplo, diag, n, ap, work )
214 IF( anorm.GT.zero )
THEN
227 CALL slacn2( n, work( n+1 ), work, iwork, ainvnm, kase, isave )
229 IF( kase.EQ.kase1 )
THEN
233 CALL slatps( uplo,
'No transpose', diag, normin, n, ap,
234 $ work, scale, work( 2*n+1 ), info )
239 CALL slatps( uplo,
'Transpose', diag, normin, n, ap,
240 $ work, scale, work( 2*n+1 ), info )
246 IF( scale.NE.one )
THEN
248 xnorm = abs( work( ix ) )
249 IF( scale.LT.xnorm*smlnum .OR. scale.EQ.zero )
251 CALL srscl( n, scale, work, 1 )
259 $ rcond = ( one / anorm ) / ainvnm
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...
subroutine srscl(N, SA, SX, INCX)
SRSCL multiplies a vector by the reciprocal of a real scalar.
subroutine slatps(UPLO, TRANS, DIAG, NORMIN, N, AP, X, SCALE, CNORM, INFO)
SLATPS solves a triangular system of equations with the matrix held in packed storage.
integer function isamax(N, SX, INCX)
ISAMAX
real function slantp(NORM, UPLO, DIAG, N, AP, WORK)
SLANTP returns the value of the 1-norm, or the Frobenius norm, or the infinity norm,...
subroutine xerbla(SRNAME, INFO)
XERBLA
logical function lsame(CA, CB)
LSAME
real function slamch(CMACH)
SLAMCH