LAPACK  3.8.0
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

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

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
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
December 2016

Definition at line 145 of file ctbcon.f.

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