LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ dgbcon()

subroutine dgbcon ( character  NORM,
integer  N,
integer  KL,
integer  KU,
double precision, dimension( ldab, * )  AB,
integer  LDAB,
integer, dimension( * )  IPIV,
double precision  ANORM,
double precision  RCOND,
double precision, dimension( * )  WORK,
integer, dimension( * )  IWORK,
integer  INFO 
)

DGBCON

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

Purpose:
 DGBCON estimates the reciprocal of the condition number of a real
 general band matrix A, in either the 1-norm or the infinity-norm,
 using the LU factorization computed by DGBTRF.

 An estimate is obtained for norm(inv(A)), and 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]N
          N is INTEGER
          The order of the matrix A.  N >= 0.
[in]KL
          KL is INTEGER
          The number of subdiagonals within the band of A.  KL >= 0.
[in]KU
          KU is INTEGER
          The number of superdiagonals within the band of A.  KU >= 0.
[in]AB
          AB is DOUBLE PRECISION array, dimension (LDAB,N)
          Details of the LU factorization of the band matrix A, as
          computed by DGBTRF.  U is stored as an upper triangular band
          matrix with KL+KU superdiagonals in rows 1 to KL+KU+1, and
          the multipliers used during the factorization are stored in
          rows KL+KU+2 to 2*KL+KU+1.
[in]LDAB
          LDAB is INTEGER
          The leading dimension of the array AB.  LDAB >= 2*KL+KU+1.
[in]IPIV
          IPIV is INTEGER array, dimension (N)
          The pivot indices; for 1 <= i <= N, row i of the matrix was
          interchanged with row IPIV(i).
[in]ANORM
          ANORM is DOUBLE PRECISION
          If NORM = '1' or 'O', the 1-norm of the original matrix A.
          If NORM = 'I', the infinity-norm of the original matrix A.
[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
December 2016

Definition at line 148 of file dgbcon.f.

148 *
149 * -- LAPACK computational routine (version 3.7.0) --
150 * -- LAPACK is a software package provided by Univ. of Tennessee, --
151 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
152 * December 2016
153 *
154 * .. Scalar Arguments ..
155  CHARACTER norm
156  INTEGER info, kl, ku, ldab, n
157  DOUBLE PRECISION anorm, rcond
158 * ..
159 * .. Array Arguments ..
160  INTEGER ipiv( * ), iwork( * )
161  DOUBLE PRECISION ab( ldab, * ), work( * )
162 * ..
163 *
164 * =====================================================================
165 *
166 * .. Parameters ..
167  DOUBLE PRECISION one, zero
168  parameter( one = 1.0d+0, zero = 0.0d+0 )
169 * ..
170 * .. Local Scalars ..
171  LOGICAL lnoti, onenrm
172  CHARACTER normin
173  INTEGER ix, j, jp, kase, kase1, kd, lm
174  DOUBLE PRECISION ainvnm, scale, smlnum, t
175 * ..
176 * .. Local Arrays ..
177  INTEGER isave( 3 )
178 * ..
179 * .. External Functions ..
180  LOGICAL lsame
181  INTEGER idamax
182  DOUBLE PRECISION ddot, dlamch
183  EXTERNAL lsame, idamax, ddot, dlamch
184 * ..
185 * .. External Subroutines ..
186  EXTERNAL daxpy, dlacn2, dlatbs, drscl, xerbla
187 * ..
188 * .. Intrinsic Functions ..
189  INTRINSIC abs, min
190 * ..
191 * .. Executable Statements ..
192 *
193 * Test the input parameters.
194 *
195  info = 0
196  onenrm = norm.EQ.'1' .OR. lsame( norm, 'O' )
197  IF( .NOT.onenrm .AND. .NOT.lsame( norm, 'I' ) ) THEN
198  info = -1
199  ELSE IF( n.LT.0 ) THEN
200  info = -2
201  ELSE IF( kl.LT.0 ) THEN
202  info = -3
203  ELSE IF( ku.LT.0 ) THEN
204  info = -4
205  ELSE IF( ldab.LT.2*kl+ku+1 ) THEN
206  info = -6
207  ELSE IF( anorm.LT.zero ) THEN
208  info = -8
209  END IF
210  IF( info.NE.0 ) THEN
211  CALL xerbla( 'DGBCON', -info )
212  RETURN
213  END IF
214 *
215 * Quick return if possible
216 *
217  rcond = zero
218  IF( n.EQ.0 ) THEN
219  rcond = one
220  RETURN
221  ELSE IF( anorm.EQ.zero ) THEN
222  RETURN
223  END IF
224 *
225  smlnum = dlamch( 'Safe minimum' )
226 *
227 * Estimate the norm of inv(A).
228 *
229  ainvnm = zero
230  normin = 'N'
231  IF( onenrm ) THEN
232  kase1 = 1
233  ELSE
234  kase1 = 2
235  END IF
236  kd = kl + ku + 1
237  lnoti = kl.GT.0
238  kase = 0
239  10 CONTINUE
240  CALL dlacn2( n, work( n+1 ), work, iwork, ainvnm, kase, isave )
241  IF( kase.NE.0 ) THEN
242  IF( kase.EQ.kase1 ) THEN
243 *
244 * Multiply by inv(L).
245 *
246  IF( lnoti ) THEN
247  DO 20 j = 1, n - 1
248  lm = min( kl, n-j )
249  jp = ipiv( j )
250  t = work( jp )
251  IF( jp.NE.j ) THEN
252  work( jp ) = work( j )
253  work( j ) = t
254  END IF
255  CALL daxpy( lm, -t, ab( kd+1, j ), 1, work( j+1 ), 1 )
256  20 CONTINUE
257  END IF
258 *
259 * Multiply by inv(U).
260 *
261  CALL dlatbs( 'Upper', 'No transpose', 'Non-unit', normin, n,
262  $ kl+ku, ab, ldab, work, scale, work( 2*n+1 ),
263  $ info )
264  ELSE
265 *
266 * Multiply by inv(U**T).
267 *
268  CALL dlatbs( 'Upper', 'Transpose', 'Non-unit', normin, n,
269  $ kl+ku, ab, ldab, work, scale, work( 2*n+1 ),
270  $ info )
271 *
272 * Multiply by inv(L**T).
273 *
274  IF( lnoti ) THEN
275  DO 30 j = n - 1, 1, -1
276  lm = min( kl, n-j )
277  work( j ) = work( j ) - ddot( lm, ab( kd+1, j ), 1,
278  $ work( j+1 ), 1 )
279  jp = ipiv( j )
280  IF( jp.NE.j ) THEN
281  t = work( jp )
282  work( jp ) = work( j )
283  work( j ) = t
284  END IF
285  30 CONTINUE
286  END IF
287  END IF
288 *
289 * Divide X by 1/SCALE if doing so will not cause overflow.
290 *
291  normin = 'Y'
292  IF( scale.NE.one ) THEN
293  ix = idamax( n, work, 1 )
294  IF( scale.LT.abs( work( ix ) )*smlnum .OR. scale.EQ.zero )
295  $ GO TO 40
296  CALL drscl( n, scale, work, 1 )
297  END IF
298  GO TO 10
299  END IF
300 *
301 * Compute the estimate of the reciprocal condition number.
302 *
303  IF( ainvnm.NE.zero )
304  $ rcond = ( one / ainvnm ) / anorm
305 *
306  40 CONTINUE
307  RETURN
308 *
309 * End of DGBCON
310 *
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:65
integer function idamax(N, DX, INCX)
IDAMAX
Definition: idamax.f:73
double precision function ddot(N, DX, INCX, DY, INCY)
DDOT
Definition: ddot.f:84
subroutine daxpy(N, DA, DX, INCX, DY, INCY)
DAXPY
Definition: daxpy.f:91
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
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:62
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55
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
subroutine drscl(N, SA, SX, INCX)
DRSCL multiplies a vector by the reciprocal of a real scalar.
Definition: drscl.f:86
Here is the call graph for this function:
Here is the caller graph for this function: