LAPACK 3.12.0
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ dtbcon()

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.

Definition at line 141 of file dtbcon.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 INTEGER IWORK( * )
155 DOUBLE PRECISION 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* ..
170* .. Local Arrays ..
171 INTEGER ISAVE( 3 )
172* ..
173* .. External Functions ..
174 LOGICAL LSAME
175 INTEGER IDAMAX
176 DOUBLE PRECISION DLAMCH, DLANTB
177 EXTERNAL lsame, idamax, dlamch, dlantb
178* ..
179* .. External Subroutines ..
180 EXTERNAL dlacn2, dlatbs, drscl, xerbla
181* ..
182* .. Intrinsic Functions ..
183 INTRINSIC abs, dble, max
184* ..
185* .. Executable Statements ..
186*
187* Test the input parameters.
188*
189 info = 0
190 upper = lsame( uplo, 'U' )
191 onenrm = norm.EQ.'1' .OR. lsame( norm, 'O' )
192 nounit = lsame( diag, 'N' )
193*
194 IF( .NOT.onenrm .AND. .NOT.lsame( norm, 'I' ) ) THEN
195 info = -1
196 ELSE IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
197 info = -2
198 ELSE IF( .NOT.nounit .AND. .NOT.lsame( diag, 'U' ) ) THEN
199 info = -3
200 ELSE IF( n.LT.0 ) THEN
201 info = -4
202 ELSE IF( kd.LT.0 ) THEN
203 info = -5
204 ELSE IF( ldab.LT.kd+1 ) THEN
205 info = -7
206 END IF
207 IF( info.NE.0 ) THEN
208 CALL xerbla( 'DTBCON', -info )
209 RETURN
210 END IF
211*
212* Quick return if possible
213*
214 IF( n.EQ.0 ) THEN
215 rcond = one
216 RETURN
217 END IF
218*
219 rcond = zero
220 smlnum = dlamch( 'Safe minimum' )*dble( max( 1, n ) )
221*
222* Compute the norm of the triangular matrix A.
223*
224 anorm = dlantb( norm, uplo, diag, n, kd, ab, ldab, work )
225*
226* Continue only if ANORM > 0.
227*
228 IF( anorm.GT.zero ) THEN
229*
230* Estimate the norm of the inverse of A.
231*
232 ainvnm = zero
233 normin = 'N'
234 IF( onenrm ) THEN
235 kase1 = 1
236 ELSE
237 kase1 = 2
238 END IF
239 kase = 0
240 10 CONTINUE
241 CALL dlacn2( n, work( n+1 ), work, iwork, ainvnm, kase, isave )
242 IF( kase.NE.0 ) THEN
243 IF( kase.EQ.kase1 ) THEN
244*
245* Multiply by inv(A).
246*
247 CALL dlatbs( uplo, 'No transpose', diag, normin, n, kd,
248 $ ab, ldab, work, scale, work( 2*n+1 ), info )
249 ELSE
250*
251* Multiply by inv(A**T).
252*
253 CALL dlatbs( uplo, 'Transpose', diag, normin, n, kd, ab,
254 $ ldab, work, scale, work( 2*n+1 ), info )
255 END IF
256 normin = 'Y'
257*
258* Multiply by 1/SCALE if doing so will not cause overflow.
259*
260 IF( scale.NE.one ) THEN
261 ix = idamax( n, work, 1 )
262 xnorm = abs( work( ix ) )
263 IF( scale.LT.xnorm*smlnum .OR. scale.EQ.zero )
264 $ GO TO 20
265 CALL drscl( n, scale, work, 1 )
266 END IF
267 GO TO 10
268 END IF
269*
270* Compute the estimate of the reciprocal condition number.
271*
272 IF( ainvnm.NE.zero )
273 $ rcond = ( one / anorm ) / ainvnm
274 END IF
275*
276 20 CONTINUE
277 RETURN
278*
279* End of DTBCON
280*
subroutine xerbla(srname, info)
Definition cblat2.f:3285
integer function idamax(n, dx, incx)
IDAMAX
Definition idamax.f:71
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:136
double precision function dlamch(cmach)
DLAMCH
Definition dlamch.f:69
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,...
Definition dlantb.f:140
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:242
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48
subroutine drscl(n, sa, sx, incx)
DRSCL multiplies a vector by the reciprocal of a real scalar.
Definition drscl.f:84
Here is the call graph for this function:
Here is the caller graph for this function: