LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
subroutine dtbcon ( character  NORM,
character  UPLO,
character  DIAG,
integer  N,
integer  KD,
double precision, dimension( ldab, * )  AB,
integer  LDAB,
double precision  RCOND,
double precision, dimension( * )  WORK,
integer, dimension( * )  IWORK,
integer  INFO 
)

DTBCON

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

Purpose:
 DTBCON 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 DOUBLE PRECISION 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 DOUBLE PRECISION array, dimension (3*N)
[out]IWORK
          IWORK is INTEGER 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
November 2011

Definition at line 145 of file dtbcon.f.

145 *
146 * -- LAPACK computational routine (version 3.4.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 * November 2011
150 *
151 * .. Scalar Arguments ..
152  CHARACTER diag, norm, uplo
153  INTEGER info, kd, ldab, n
154  DOUBLE PRECISION rcond
155 * ..
156 * .. Array Arguments ..
157  INTEGER iwork( * )
158  DOUBLE PRECISION ab( ldab, * ), work( * )
159 * ..
160 *
161 * =====================================================================
162 *
163 * .. Parameters ..
164  DOUBLE PRECISION one, zero
165  parameter ( one = 1.0d+0, zero = 0.0d+0 )
166 * ..
167 * .. Local Scalars ..
168  LOGICAL nounit, onenrm, upper
169  CHARACTER normin
170  INTEGER ix, kase, kase1
171  DOUBLE PRECISION ainvnm, anorm, scale, smlnum, xnorm
172 * ..
173 * .. Local Arrays ..
174  INTEGER isave( 3 )
175 * ..
176 * .. External Functions ..
177  LOGICAL lsame
178  INTEGER idamax
179  DOUBLE PRECISION dlamch, dlantb
180  EXTERNAL lsame, idamax, dlamch, dlantb
181 * ..
182 * .. External Subroutines ..
183  EXTERNAL dlacn2, dlatbs, drscl, xerbla
184 * ..
185 * .. Intrinsic Functions ..
186  INTRINSIC abs, dble, max
187 * ..
188 * .. Executable Statements ..
189 *
190 * Test the input parameters.
191 *
192  info = 0
193  upper = lsame( uplo, 'U' )
194  onenrm = norm.EQ.'1' .OR. lsame( norm, 'O' )
195  nounit = lsame( diag, 'N' )
196 *
197  IF( .NOT.onenrm .AND. .NOT.lsame( norm, 'I' ) ) THEN
198  info = -1
199  ELSE IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
200  info = -2
201  ELSE IF( .NOT.nounit .AND. .NOT.lsame( diag, 'U' ) ) THEN
202  info = -3
203  ELSE IF( n.LT.0 ) THEN
204  info = -4
205  ELSE IF( kd.LT.0 ) THEN
206  info = -5
207  ELSE IF( ldab.LT.kd+1 ) THEN
208  info = -7
209  END IF
210  IF( info.NE.0 ) THEN
211  CALL xerbla( 'DTBCON', -info )
212  RETURN
213  END IF
214 *
215 * Quick return if possible
216 *
217  IF( n.EQ.0 ) THEN
218  rcond = one
219  RETURN
220  END IF
221 *
222  rcond = zero
223  smlnum = dlamch( 'Safe minimum' )*dble( max( 1, n ) )
224 *
225 * Compute the norm of the triangular matrix A.
226 *
227  anorm = dlantb( norm, uplo, diag, n, kd, ab, ldab, work )
228 *
229 * Continue only if ANORM > 0.
230 *
231  IF( anorm.GT.zero ) THEN
232 *
233 * Estimate the norm of the inverse of A.
234 *
235  ainvnm = zero
236  normin = 'N'
237  IF( onenrm ) THEN
238  kase1 = 1
239  ELSE
240  kase1 = 2
241  END IF
242  kase = 0
243  10 CONTINUE
244  CALL dlacn2( n, work( n+1 ), work, iwork, ainvnm, kase, isave )
245  IF( kase.NE.0 ) THEN
246  IF( kase.EQ.kase1 ) THEN
247 *
248 * Multiply by inv(A).
249 *
250  CALL dlatbs( uplo, 'No transpose', diag, normin, n, kd,
251  $ ab, ldab, work, scale, work( 2*n+1 ), info )
252  ELSE
253 *
254 * Multiply by inv(A**T).
255 *
256  CALL dlatbs( uplo, 'Transpose', diag, normin, n, kd, ab,
257  $ ldab, work, scale, work( 2*n+1 ), info )
258  END IF
259  normin = 'Y'
260 *
261 * Multiply by 1/SCALE if doing so will not cause overflow.
262 *
263  IF( scale.NE.one ) THEN
264  ix = idamax( n, work, 1 )
265  xnorm = abs( work( ix ) )
266  IF( scale.LT.xnorm*smlnum .OR. scale.EQ.zero )
267  $ GO TO 20
268  CALL drscl( n, scale, work, 1 )
269  END IF
270  GO TO 10
271  END IF
272 *
273 * Compute the estimate of the reciprocal condition number.
274 *
275  IF( ainvnm.NE.zero )
276  $ rcond = ( one / anorm ) / ainvnm
277  END IF
278 *
279  20 CONTINUE
280  RETURN
281 *
282 * End of DTBCON
283 *
integer function idamax(N, DX, INCX)
IDAMAX
Definition: idamax.f:53
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:65
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:62
subroutine drscl(N, SA, SX, INCX)
DRSCL multiplies a vector by the reciprocal of a real scalar.
Definition: drscl.f:86
subroutine dlatbs(UPLO, TRANS, DIAG, NORMIN, N, KD, AB, LDAB, X, SCALE, CNORM, INFO)
DLATBS solves a triangular banded system of equations.
Definition: dlatbs.f:244
double precision function dlantb(NORM, UPLO, DIAG, N, K, AB, LDAB, WORK)
DLANTB 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: dlantb.f:142
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55
subroutine dlacn2(N, V, X, ISGN, EST, KASE, ISAVE)
DLACN2 estimates the 1-norm of a square matrix, using reverse communication for evaluating matrix-vec...
Definition: dlacn2.f:138

Here is the call graph for this function:

Here is the caller graph for this function: