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

◆ stbcon()

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.

Definition at line 139 of file stbcon.f.

142*
143* -- LAPACK computational routine --
144* -- LAPACK is a software package provided by Univ. of Tennessee, --
145* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
146*
147* .. Scalar Arguments ..
148 CHARACTER DIAG, NORM, UPLO
149 INTEGER INFO, KD, LDAB, N
150 REAL RCOND
151* ..
152* .. Array Arguments ..
153 INTEGER IWORK( * )
154 REAL AB( LDAB, * ), WORK( * )
155* ..
156*
157* =====================================================================
158*
159* .. Parameters ..
160 REAL ONE, ZERO
161 parameter( one = 1.0e+0, zero = 0.0e+0 )
162* ..
163* .. Local Scalars ..
164 LOGICAL NOUNIT, ONENRM, UPPER
165 CHARACTER NORMIN
166 INTEGER IX, KASE, KASE1
167 REAL AINVNM, ANORM, SCALE, SMLNUM, XNORM
168* ..
169* .. Local Arrays ..
170 INTEGER ISAVE( 3 )
171* ..
172* .. External Functions ..
173 LOGICAL LSAME
174 INTEGER ISAMAX
175 REAL SLAMCH, SLANTB
176 EXTERNAL lsame, isamax, slamch, slantb
177* ..
178* .. External Subroutines ..
179 EXTERNAL slacn2, slatbs, srscl, xerbla
180* ..
181* .. Intrinsic Functions ..
182 INTRINSIC abs, max, real
183* ..
184* .. Executable Statements ..
185*
186* Test the input parameters.
187*
188 info = 0
189 upper = lsame( uplo, 'U' )
190 onenrm = norm.EQ.'1' .OR. lsame( norm, 'O' )
191 nounit = lsame( diag, 'N' )
192*
193 IF( .NOT.onenrm .AND. .NOT.lsame( norm, 'I' ) ) THEN
194 info = -1
195 ELSE IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
196 info = -2
197 ELSE IF( .NOT.nounit .AND. .NOT.lsame( diag, 'U' ) ) THEN
198 info = -3
199 ELSE IF( n.LT.0 ) THEN
200 info = -4
201 ELSE IF( kd.LT.0 ) THEN
202 info = -5
203 ELSE IF( ldab.LT.kd+1 ) THEN
204 info = -7
205 END IF
206 IF( info.NE.0 ) THEN
207 CALL xerbla( 'STBCON', -info )
208 RETURN
209 END IF
210*
211* Quick return if possible
212*
213 IF( n.EQ.0 ) THEN
214 rcond = one
215 RETURN
216 END IF
217*
218 rcond = zero
219 smlnum = slamch( 'Safe minimum' )*real( max( 1, n ) )
220*
221* Compute the norm of the triangular matrix A.
222*
223 anorm = slantb( norm, uplo, diag, n, kd, ab, ldab, work )
224*
225* Continue only if ANORM > 0.
226*
227 IF( anorm.GT.zero ) THEN
228*
229* Estimate the norm of the inverse of A.
230*
231 ainvnm = zero
232 normin = 'N'
233 IF( onenrm ) THEN
234 kase1 = 1
235 ELSE
236 kase1 = 2
237 END IF
238 kase = 0
239 10 CONTINUE
240 CALL slacn2( n, work( n+1 ), work, iwork, ainvnm, kase,
241 $ isave )
242 IF( kase.NE.0 ) THEN
243 IF( kase.EQ.kase1 ) THEN
244*
245* Multiply by inv(A).
246*
247 CALL slatbs( uplo, 'No transpose', diag, normin, n,
248 $ kd,
249 $ ab, ldab, work, scale, work( 2*n+1 ), info )
250 ELSE
251*
252* Multiply by inv(A**T).
253*
254 CALL slatbs( uplo, 'Transpose', diag, normin, n, kd,
255 $ ab,
256 $ ldab, work, scale, work( 2*n+1 ), info )
257 END IF
258 normin = 'Y'
259*
260* Multiply by 1/SCALE if doing so will not cause overflow.
261*
262 IF( scale.NE.one ) THEN
263 ix = isamax( n, work, 1 )
264 xnorm = abs( work( ix ) )
265 IF( scale.LT.xnorm*smlnum .OR. scale.EQ.zero )
266 $ GO TO 20
267 CALL srscl( n, scale, work, 1 )
268 END IF
269 GO TO 10
270 END IF
271*
272* Compute the estimate of the reciprocal condition number.
273*
274 IF( ainvnm.NE.zero )
275 $ rcond = ( one / anorm ) / ainvnm
276 END IF
277*
278 20 CONTINUE
279 RETURN
280*
281* End of STBCON
282*
subroutine xerbla(srname, info)
Definition cblat2.f:3285
integer function isamax(n, sx, incx)
ISAMAX
Definition isamax.f:71
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:134
real function slamch(cmach)
SLAMCH
Definition slamch.f:68
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,...
Definition slantb.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:241
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48
subroutine srscl(n, sa, sx, incx)
SRSCL multiplies a vector by the reciprocal of a real scalar.
Definition srscl.f:82
Here is the call graph for this function:
Here is the caller graph for this function: