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

STBCON

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

Purpose:
 STBCON 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 REAL 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 REAL 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 stbcon.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  REAL rcond
155 * ..
156 * .. Array Arguments ..
157  INTEGER iwork( * )
158  REAL 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 * ..
173 * .. Local Arrays ..
174  INTEGER isave( 3 )
175 * ..
176 * .. External Functions ..
177  LOGICAL lsame
178  INTEGER isamax
179  REAL slamch, slantb
180  EXTERNAL lsame, isamax, slamch, slantb
181 * ..
182 * .. External Subroutines ..
183  EXTERNAL slacn2, slatbs, srscl, xerbla
184 * ..
185 * .. Intrinsic Functions ..
186  INTRINSIC abs, max, real
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( 'STBCON', -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 = slamch( 'Safe minimum' )*REAL( MAX( 1, N ) )
224 *
225 * Compute the norm of the triangular matrix A.
226 *
227  anorm = slantb( 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 slacn2( 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 slatbs( 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 slatbs( 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 = isamax( n, work, 1 )
265  xnorm = abs( work( ix ) )
266  IF( scale.LT.xnorm*smlnum .OR. scale.EQ.zero )
267  $ GO TO 20
268  CALL srscl( 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 STBCON
283 *
subroutine srscl(N, SA, SX, INCX)
SRSCL multiplies a vector by the reciprocal of a real scalar.
Definition: srscl.f:86
integer function isamax(N, SX, INCX)
ISAMAX
Definition: isamax.f:53
real function slantb(NORM, UPLO, DIAG, N, K, AB, LDAB, WORK)
SLANTB 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: slantb.f:142
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:62
subroutine slacn2(N, V, X, ISGN, EST, KASE, ISAVE)
SLACN2 estimates the 1-norm of a square matrix, using reverse communication for evaluating matrix-vec...
Definition: slacn2.f:138
subroutine slatbs(UPLO, TRANS, DIAG, NORMIN, N, KD, AB, LDAB, X, SCALE, CNORM, INFO)
SLATBS solves a triangular banded system of equations.
Definition: slatbs.f:244
real function slamch(CMACH)
SLAMCH
Definition: slamch.f:69
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55

Here is the call graph for this function:

Here is the caller graph for this function: