LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ stpt06()

subroutine stpt06 ( real  RCOND,
real  RCONDC,
character  UPLO,
character  DIAG,
integer  N,
real, dimension( * )  AP,
real, dimension( * )  WORK,
real  RAT 
)

STPT06

Purpose:
 STPT06 computes a test ratio comparing RCOND (the reciprocal
 condition number of a triangular matrix A) and RCONDC, the estimate
 computed by STPCON.  Information about the triangular matrix A is
 used if one estimate is zero and the other is non-zero to decide if
 underflow in the estimate is justified.
Parameters
[in]RCOND
          RCOND is REAL
          The estimate of the reciprocal condition number obtained by
          forming the explicit inverse of the matrix A and computing
          RCOND = 1/( norm(A) * norm(inv(A)) ).
[in]RCONDC
          RCONDC is REAL
          The estimate of the reciprocal condition number computed by
          STPCON.
[in]UPLO
          UPLO is CHARACTER
          Specifies whether the matrix A is upper or lower triangular.
          = 'U':  Upper triangular
          = 'L':  Lower triangular
[in]DIAG
          DIAG is CHARACTER
          Specifies whether or not the matrix A is unit triangular.
          = 'N':  Non-unit triangular
          = 'U':  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((j-1)*j/2 + i) = A(i,j) for 1<=i<=j;
          if UPLO = 'L',
             AP((j-1)*(n-j) + j*(j+1)/2 + i-j) = A(i,j) for j<=i<=n.
[out]WORK
          WORK is REAL array, dimension (N)
[out]RAT
          RAT is REAL
          The test ratio.  If both RCOND and RCONDC are nonzero,
             RAT = MAX( RCOND, RCONDC )/MIN( RCOND, RCONDC ) - 1.
          If RAT = 0, the two estimates are exactly the same.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
December 2016

Definition at line 113 of file stpt06.f.

113 *
114 * -- LAPACK test routine (version 3.7.0) --
115 * -- LAPACK is a software package provided by Univ. of Tennessee, --
116 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
117 * December 2016
118 *
119 * .. Scalar Arguments ..
120  CHARACTER diag, uplo
121  INTEGER n
122  REAL rat, rcond, rcondc
123 * ..
124 * .. Array Arguments ..
125  REAL ap( * ), work( * )
126 * ..
127 *
128 * =====================================================================
129 *
130 * .. Parameters ..
131  REAL zero, one
132  parameter( zero = 0.0e+0, one = 1.0e+0 )
133 * ..
134 * .. Local Scalars ..
135  REAL anorm, bignum, eps, rmax, rmin, smlnum
136 * ..
137 * .. External Functions ..
138  REAL slamch, slantp
139  EXTERNAL slamch, slantp
140 * ..
141 * .. Intrinsic Functions ..
142  INTRINSIC max, min
143 * ..
144 * .. External Subroutines ..
145  EXTERNAL slabad
146 * ..
147 * .. Executable Statements ..
148 *
149  eps = slamch( 'Epsilon' )
150  rmax = max( rcond, rcondc )
151  rmin = min( rcond, rcondc )
152 *
153 * Do the easy cases first.
154 *
155  IF( rmin.LT.zero ) THEN
156 *
157 * Invalid value for RCOND or RCONDC, return 1/EPS.
158 *
159  rat = one / eps
160 *
161  ELSE IF( rmin.GT.zero ) THEN
162 *
163 * Both estimates are positive, return RMAX/RMIN - 1.
164 *
165  rat = rmax / rmin - one
166 *
167  ELSE IF( rmax.EQ.zero ) THEN
168 *
169 * Both estimates zero.
170 *
171  rat = zero
172 *
173  ELSE
174 *
175 * One estimate is zero, the other is non-zero. If the matrix is
176 * ill-conditioned, return the nonzero estimate multiplied by
177 * 1/EPS; if the matrix is badly scaled, return the nonzero
178 * estimate multiplied by BIGNUM/TMAX, where TMAX is the maximum
179 * element in absolute value in A.
180 *
181  smlnum = slamch( 'Safe minimum' )
182  bignum = one / smlnum
183  CALL slabad( smlnum, bignum )
184  anorm = slantp( 'M', uplo, diag, n, ap, work )
185 *
186  rat = rmax*( min( bignum / max( one, anorm ), one / eps ) )
187  END IF
188 *
189  RETURN
190 *
191 * End of STPT06
192 *
real function slamch(CMACH)
SLAMCH
Definition: slamch.f:69
subroutine slabad(SMALL, LARGE)
SLABAD
Definition: slabad.f:76
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, or the element of largest absolute value of a triangular matrix supplied in packed form.
Definition: slantp.f:126
Here is the call graph for this function:
Here is the caller graph for this function: