LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ spbcon()

subroutine spbcon ( character  UPLO,
integer  N,
integer  KD,
real, dimension( ldab, * )  AB,
integer  LDAB,
real  ANORM,
real  RCOND,
real, dimension( * )  WORK,
integer, dimension( * )  IWORK,
integer  INFO 
)

SPBCON

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

Purpose:
 SPBCON estimates the reciprocal of the condition number (in the
 1-norm) of a real symmetric positive definite band matrix using the
 Cholesky factorization A = U**T*U or A = L*L**T computed by SPBTRF.

 An estimate is obtained for norm(inv(A)), and the reciprocal of the
 condition number is computed as RCOND = 1 / (ANORM * norm(inv(A))).
Parameters
[in]UPLO
          UPLO is CHARACTER*1
          = 'U':  Upper triangular factor stored in AB;
          = 'L':  Lower triangular factor stored in AB.
[in]N
          N is INTEGER
          The order of the matrix A.  N >= 0.
[in]KD
          KD is INTEGER
          The number of superdiagonals of the matrix A if UPLO = 'U',
          or the number of subdiagonals if UPLO = 'L'.  KD >= 0.
[in]AB
          AB is REAL array, dimension (LDAB,N)
          The triangular factor U or L from the Cholesky factorization
          A = U**T*U or A = L*L**T of the band matrix A, stored in the
          first KD+1 rows of the array.  The j-th column of U or L is
          stored in the j-th column of the array AB as follows:
          if UPLO ='U', AB(kd+1+i-j,j) = U(i,j) for max(1,j-kd)<=i<=j;
          if UPLO ='L', AB(1+i-j,j)    = L(i,j) for j<=i<=min(n,j+kd).
[in]LDAB
          LDAB is INTEGER
          The leading dimension of the array AB.  LDAB >= KD+1.
[in]ANORM
          ANORM is REAL
          The 1-norm (or infinity-norm) of the symmetric band matrix A.
[out]RCOND
          RCOND is REAL
          The reciprocal of the condition number of the matrix A,
          computed as RCOND = 1/(ANORM * AINVNM), where AINVNM is an
          estimate of the 1-norm of inv(A) computed in this routine.
[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
December 2016

Definition at line 134 of file spbcon.f.

134 *
135 * -- LAPACK computational routine (version 3.7.0) --
136 * -- LAPACK is a software package provided by Univ. of Tennessee, --
137 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
138 * December 2016
139 *
140 * .. Scalar Arguments ..
141  CHARACTER uplo
142  INTEGER info, kd, ldab, n
143  REAL anorm, rcond
144 * ..
145 * .. Array Arguments ..
146  INTEGER iwork( * )
147  REAL ab( ldab, * ), work( * )
148 * ..
149 *
150 * =====================================================================
151 *
152 * .. Parameters ..
153  REAL one, zero
154  parameter( one = 1.0e+0, zero = 0.0e+0 )
155 * ..
156 * .. Local Scalars ..
157  LOGICAL upper
158  CHARACTER normin
159  INTEGER ix, kase
160  REAL ainvnm, scale, scalel, scaleu, smlnum
161 * ..
162 * .. Local Arrays ..
163  INTEGER isave( 3 )
164 * ..
165 * .. External Functions ..
166  LOGICAL lsame
167  INTEGER isamax
168  REAL slamch
169  EXTERNAL lsame, isamax, slamch
170 * ..
171 * .. External Subroutines ..
172  EXTERNAL slacn2, slatbs, srscl, xerbla
173 * ..
174 * .. Intrinsic Functions ..
175  INTRINSIC abs
176 * ..
177 * .. Executable Statements ..
178 *
179 * Test the input parameters.
180 *
181  info = 0
182  upper = lsame( uplo, 'U' )
183  IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
184  info = -1
185  ELSE IF( n.LT.0 ) THEN
186  info = -2
187  ELSE IF( kd.LT.0 ) THEN
188  info = -3
189  ELSE IF( ldab.LT.kd+1 ) THEN
190  info = -5
191  ELSE IF( anorm.LT.zero ) THEN
192  info = -6
193  END IF
194  IF( info.NE.0 ) THEN
195  CALL xerbla( 'SPBCON', -info )
196  RETURN
197  END IF
198 *
199 * Quick return if possible
200 *
201  rcond = zero
202  IF( n.EQ.0 ) THEN
203  rcond = one
204  RETURN
205  ELSE IF( anorm.EQ.zero ) THEN
206  RETURN
207  END IF
208 *
209  smlnum = slamch( 'Safe minimum' )
210 *
211 * Estimate the 1-norm of the inverse.
212 *
213  kase = 0
214  normin = 'N'
215  10 CONTINUE
216  CALL slacn2( n, work( n+1 ), work, iwork, ainvnm, kase, isave )
217  IF( kase.NE.0 ) THEN
218  IF( upper ) THEN
219 *
220 * Multiply by inv(U**T).
221 *
222  CALL slatbs( 'Upper', 'Transpose', 'Non-unit', normin, n,
223  $ kd, ab, ldab, work, scalel, work( 2*n+1 ),
224  $ info )
225  normin = 'Y'
226 *
227 * Multiply by inv(U).
228 *
229  CALL slatbs( 'Upper', 'No transpose', 'Non-unit', normin, n,
230  $ kd, ab, ldab, work, scaleu, work( 2*n+1 ),
231  $ info )
232  ELSE
233 *
234 * Multiply by inv(L).
235 *
236  CALL slatbs( 'Lower', 'No transpose', 'Non-unit', normin, n,
237  $ kd, ab, ldab, work, scalel, work( 2*n+1 ),
238  $ info )
239  normin = 'Y'
240 *
241 * Multiply by inv(L**T).
242 *
243  CALL slatbs( 'Lower', 'Transpose', 'Non-unit', normin, n,
244  $ kd, ab, ldab, work, scaleu, work( 2*n+1 ),
245  $ info )
246  END IF
247 *
248 * Multiply by 1/SCALE if doing so will not cause overflow.
249 *
250  scale = scalel*scaleu
251  IF( scale.NE.one ) THEN
252  ix = isamax( n, work, 1 )
253  IF( scale.LT.abs( work( ix ) )*smlnum .OR. scale.EQ.zero )
254  $ GO TO 20
255  CALL srscl( n, scale, work, 1 )
256  END IF
257  GO TO 10
258  END IF
259 *
260 * Compute the estimate of the reciprocal condition number.
261 *
262  IF( ainvnm.NE.zero )
263  $ rcond = ( one / ainvnm ) / anorm
264 *
265  20 CONTINUE
266 *
267  RETURN
268 *
269 * End of SPBCON
270 *
subroutine srscl(N, SA, SX, INCX)
SRSCL multiplies a vector by the reciprocal of a real scalar.
Definition: srscl.f:86
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
integer function isamax(N, SX, INCX)
ISAMAX
Definition: isamax.f:73
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:62
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55
real function slamch(CMACH)
SLAMCH
Definition: slamch.f:69
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
Here is the call graph for this function:
Here is the caller graph for this function: