 LAPACK  3.10.1 LAPACK: Linear Algebra PACKage

## ◆ ctbcon()

 subroutine ctbcon ( character NORM, character UPLO, character DIAG, integer N, integer KD, complex, dimension( ldab, * ) AB, integer LDAB, real RCOND, complex, dimension( * ) WORK, real, dimension( * ) RWORK, integer INFO )

CTBCON

Purpose:
``` CTBCON estimates the reciprocal of the condition number of a
triangular band 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] KD ``` KD is INTEGER The number of superdiagonals or subdiagonals of the triangular band matrix A. KD >= 0.``` [in] AB ``` AB is COMPLEX array, dimension (LDAB,N) The upper or lower triangular band matrix A, stored in the first kd+1 rows of the array. The j-th column of A is stored in the j-th column of the array AB as follows: if UPLO = 'U', AB(kd+1+i-j,j) = A(i,j) for max(1,j-kd)<=i<=j; if UPLO = 'L', AB(1+i-j,j) = A(i,j) for j<=i<=min(n,j+kd). If DIAG = 'U', the diagonal elements of A are not referenced and are assumed to be 1.``` [in] LDAB ``` LDAB is INTEGER The leading dimension of the array AB. LDAB >= KD+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 COMPLEX array, dimension (2*N)` [out] RWORK ` RWORK is REAL array, dimension (N)` [out] INFO ``` INFO is INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value```

Definition at line 141 of file ctbcon.f.

143 *
144 * -- LAPACK computational routine --
145 * -- LAPACK is a software package provided by Univ. of Tennessee, --
146 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
147 *
148 * .. Scalar Arguments ..
149  CHARACTER DIAG, NORM, UPLO
150  INTEGER INFO, KD, LDAB, N
151  REAL RCOND
152 * ..
153 * .. Array Arguments ..
154  REAL RWORK( * )
155  COMPLEX AB( LDAB, * ), WORK( * )
156 * ..
157 *
158 * =====================================================================
159 *
160 * .. Parameters ..
161  REAL ONE, ZERO
162  parameter( one = 1.0e+0, zero = 0.0e+0 )
163 * ..
164 * .. Local Scalars ..
165  LOGICAL NOUNIT, ONENRM, UPPER
166  CHARACTER NORMIN
167  INTEGER IX, KASE, KASE1
168  REAL AINVNM, ANORM, SCALE, SMLNUM, XNORM
169  COMPLEX ZDUM
170 * ..
171 * .. Local Arrays ..
172  INTEGER ISAVE( 3 )
173 * ..
174 * .. External Functions ..
175  LOGICAL LSAME
176  INTEGER ICAMAX
177  REAL CLANTB, SLAMCH
178  EXTERNAL lsame, icamax, clantb, slamch
179 * ..
180 * .. External Subroutines ..
181  EXTERNAL clacn2, clatbs, csrscl, xerbla
182 * ..
183 * .. Intrinsic Functions ..
184  INTRINSIC abs, aimag, max, real
185 * ..
186 * .. Statement Functions ..
187  REAL CABS1
188 * ..
189 * .. Statement Function definitions ..
190  cabs1( zdum ) = abs( real( zdum ) ) + abs( aimag( zdum ) )
191 * ..
192 * .. Executable Statements ..
193 *
194 * Test the input parameters.
195 *
196  info = 0
197  upper = lsame( uplo, 'U' )
198  onenrm = norm.EQ.'1' .OR. lsame( norm, 'O' )
199  nounit = lsame( diag, 'N' )
200 *
201  IF( .NOT.onenrm .AND. .NOT.lsame( norm, 'I' ) ) THEN
202  info = -1
203  ELSE IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
204  info = -2
205  ELSE IF( .NOT.nounit .AND. .NOT.lsame( diag, 'U' ) ) THEN
206  info = -3
207  ELSE IF( n.LT.0 ) THEN
208  info = -4
209  ELSE IF( kd.LT.0 ) THEN
210  info = -5
211  ELSE IF( ldab.LT.kd+1 ) THEN
212  info = -7
213  END IF
214  IF( info.NE.0 ) THEN
215  CALL xerbla( 'CTBCON', -info )
216  RETURN
217  END IF
218 *
219 * Quick return if possible
220 *
221  IF( n.EQ.0 ) THEN
222  rcond = one
223  RETURN
224  END IF
225 *
226  rcond = zero
227  smlnum = slamch( 'Safe minimum' )*real( max( n, 1 ) )
228 *
229 * Compute the 1-norm of the triangular matrix A or A**H.
230 *
231  anorm = clantb( norm, uplo, diag, n, kd, ab, ldab, rwork )
232 *
233 * Continue only if ANORM > 0.
234 *
235  IF( anorm.GT.zero ) THEN
236 *
237 * Estimate the 1-norm of the inverse of A.
238 *
239  ainvnm = zero
240  normin = 'N'
241  IF( onenrm ) THEN
242  kase1 = 1
243  ELSE
244  kase1 = 2
245  END IF
246  kase = 0
247  10 CONTINUE
248  CALL clacn2( n, work( n+1 ), work, ainvnm, kase, isave )
249  IF( kase.NE.0 ) THEN
250  IF( kase.EQ.kase1 ) THEN
251 *
252 * Multiply by inv(A).
253 *
254  CALL clatbs( uplo, 'No transpose', diag, normin, n, kd,
255  \$ ab, ldab, work, scale, rwork, info )
256  ELSE
257 *
258 * Multiply by inv(A**H).
259 *
260  CALL clatbs( uplo, 'Conjugate transpose', diag, normin,
261  \$ n, kd, ab, ldab, work, scale, rwork, info )
262  END IF
263  normin = 'Y'
264 *
265 * Multiply by 1/SCALE if doing so will not cause overflow.
266 *
267  IF( scale.NE.one ) THEN
268  ix = icamax( n, work, 1 )
269  xnorm = cabs1( work( ix ) )
270  IF( scale.LT.xnorm*smlnum .OR. scale.EQ.zero )
271  \$ GO TO 20
272  CALL csrscl( n, scale, work, 1 )
273  END IF
274  GO TO 10
275  END IF
276 *
277 * Compute the estimate of the reciprocal condition number.
278 *
279  IF( ainvnm.NE.zero )
280  \$ rcond = ( one / anorm ) / ainvnm
281  END IF
282 *
283  20 CONTINUE
284  RETURN
285 *
286 * End of CTBCON
287 *
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:60
integer function icamax(N, CX, INCX)
ICAMAX
Definition: icamax.f:71
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:53
real function clantb(NORM, UPLO, DIAG, N, K, AB, LDAB, WORK)
CLANTB returns the value of the 1-norm, or the Frobenius norm, or the infinity norm,...
Definition: clantb.f:141
subroutine csrscl(N, SA, SX, INCX)
CSRSCL multiplies a vector by the reciprocal of a real scalar.
Definition: csrscl.f:84
subroutine clatbs(UPLO, TRANS, DIAG, NORMIN, N, KD, AB, LDAB, X, SCALE, CNORM, INFO)
CLATBS solves a triangular banded system of equations.
Definition: clatbs.f:243
subroutine clacn2(N, V, X, EST, KASE, ISAVE)
CLACN2 estimates the 1-norm of a square matrix, using reverse communication for evaluating matrix-vec...
Definition: clacn2.f:133
real function slamch(CMACH)
SLAMCH
Definition: slamch.f:68
Here is the call graph for this function:
Here is the caller graph for this function: