LAPACK  3.10.1
LAPACK: Linear Algebra PACKage

◆ ztbcon()

subroutine ztbcon ( character  NORM,
character  UPLO,
character  DIAG,
integer  N,
integer  KD,
complex*16, dimension( ldab, * )  AB,
integer  LDAB,
double precision  RCOND,
complex*16, dimension( * )  WORK,
double precision, dimension( * )  RWORK,
integer  INFO 
)

ZTBCON

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

Purpose:
 ZTBCON 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*16 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 DOUBLE PRECISION
          The reciprocal of the condition number of the matrix A,
          computed as RCOND = 1/(norm(A) * norm(inv(A))).
[out]WORK
          WORK is COMPLEX*16 array, dimension (2*N)
[out]RWORK
          RWORK is DOUBLE PRECISION 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.

Definition at line 141 of file ztbcon.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  DOUBLE PRECISION RCOND
152 * ..
153 * .. Array Arguments ..
154  DOUBLE PRECISION RWORK( * )
155  COMPLEX*16 AB( LDAB, * ), WORK( * )
156 * ..
157 *
158 * =====================================================================
159 *
160 * .. Parameters ..
161  DOUBLE PRECISION ONE, ZERO
162  parameter( one = 1.0d+0, zero = 0.0d+0 )
163 * ..
164 * .. Local Scalars ..
165  LOGICAL NOUNIT, ONENRM, UPPER
166  CHARACTER NORMIN
167  INTEGER IX, KASE, KASE1
168  DOUBLE PRECISION AINVNM, ANORM, SCALE, SMLNUM, XNORM
169  COMPLEX*16 ZDUM
170 * ..
171 * .. Local Arrays ..
172  INTEGER ISAVE( 3 )
173 * ..
174 * .. External Functions ..
175  LOGICAL LSAME
176  INTEGER IZAMAX
177  DOUBLE PRECISION DLAMCH, ZLANTB
178  EXTERNAL lsame, izamax, dlamch, zlantb
179 * ..
180 * .. External Subroutines ..
181  EXTERNAL xerbla, zdrscl, zlacn2, zlatbs
182 * ..
183 * .. Intrinsic Functions ..
184  INTRINSIC abs, dble, dimag, max
185 * ..
186 * .. Statement Functions ..
187  DOUBLE PRECISION CABS1
188 * ..
189 * .. Statement Function definitions ..
190  cabs1( zdum ) = abs( dble( zdum ) ) + abs( dimag( 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( 'ZTBCON', -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 = dlamch( 'Safe minimum' )*dble( max( n, 1 ) )
228 *
229 * Compute the 1-norm of the triangular matrix A or A**H.
230 *
231  anorm = zlantb( 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 zlacn2( 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 zlatbs( 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 zlatbs( 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 = izamax( n, work, 1 )
269  xnorm = cabs1( work( ix ) )
270  IF( scale.LT.xnorm*smlnum .OR. scale.EQ.zero )
271  $ GO TO 20
272  CALL zdrscl( 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 ZTBCON
287 *
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:69
integer function izamax(N, ZX, INCX)
IZAMAX
Definition: izamax.f:71
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:60
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:53
subroutine zlacn2(N, V, X, EST, KASE, ISAVE)
ZLACN2 estimates the 1-norm of a square matrix, using reverse communication for evaluating matrix-vec...
Definition: zlacn2.f:133
subroutine zdrscl(N, SA, SX, INCX)
ZDRSCL multiplies a vector by the reciprocal of a real scalar.
Definition: zdrscl.f:84
double precision function zlantb(NORM, UPLO, DIAG, N, K, AB, LDAB, WORK)
ZLANTB returns the value of the 1-norm, or the Frobenius norm, or the infinity norm,...
Definition: zlantb.f:141
subroutine zlatbs(UPLO, TRANS, DIAG, NORMIN, N, KD, AB, LDAB, X, SCALE, CNORM, INFO)
ZLATBS solves a triangular banded system of equations.
Definition: zlatbs.f:243
Here is the call graph for this function:
Here is the caller graph for this function: