LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
subroutine ctpt06 ( real  RCOND,
real  RCONDC,
character  UPLO,
character  DIAG,
integer  N,
complex, dimension( * )  AP,
real, dimension( * )  RWORK,
real  RAT 
)

CTPT06

Purpose:
 CTPT06 computes a test ratio comparing RCOND (the reciprocal
 condition number of the triangular matrix A) and RCONDC, the estimate
 computed by CTPCON.  Information about the triangular matrix 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
          CTPCON.
[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 COMPLEX 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]RWORK
          RWORK 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
November 2011

Definition at line 114 of file ctpt06.f.

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

Here is the caller graph for this function: