 LAPACK  3.10.0 LAPACK: Linear Algebra PACKage

## ◆ cgbcon()

 subroutine cgbcon ( character NORM, integer N, integer KL, integer KU, complex, dimension( ldab, * ) AB, integer LDAB, integer, dimension( * ) IPIV, real ANORM, real RCOND, complex, dimension( * ) WORK, real, dimension( * ) RWORK, integer INFO )

CGBCON

Purpose:
``` CGBCON estimates the reciprocal of the condition number of a complex
general band matrix A, in either the 1-norm or the infinity-norm,
using the LU factorization computed by CGBTRF.

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 COMPLEX array, dimension (LDAB,N) Details of the LU factorization of the band matrix A, as computed by CGBTRF. 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 REAL 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 REAL The reciprocal of the condition number of the matrix A, computed as RCOND = 1/(norm(A) * norm(inv(A))).``` [out] WORK ` WORK is COMPLEX array, dimension (2*N)` [out] RWORK ` RWORK is REAL array, dimension (N)` [out] INFO ``` INFO is INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value```

Definition at line 145 of file cgbcon.f.

147 *
148 * -- LAPACK computational routine --
149 * -- LAPACK is a software package provided by Univ. of Tennessee, --
150 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
151 *
152 * .. Scalar Arguments ..
153  CHARACTER NORM
154  INTEGER INFO, KL, KU, LDAB, N
155  REAL ANORM, RCOND
156 * ..
157 * .. Array Arguments ..
158  INTEGER IPIV( * )
159  REAL RWORK( * )
160  COMPLEX AB( LDAB, * ), WORK( * )
161 * ..
162 *
163 * =====================================================================
164 *
165 * .. Parameters ..
166  REAL ONE, ZERO
167  parameter( one = 1.0e+0, zero = 0.0e+0 )
168 * ..
169 * .. Local Scalars ..
170  LOGICAL LNOTI, ONENRM
171  CHARACTER NORMIN
172  INTEGER IX, J, JP, KASE, KASE1, KD, LM
173  REAL AINVNM, SCALE, SMLNUM
174  COMPLEX T, ZDUM
175 * ..
176 * .. Local Arrays ..
177  INTEGER ISAVE( 3 )
178 * ..
179 * .. External Functions ..
180  LOGICAL LSAME
181  INTEGER ICAMAX
182  REAL SLAMCH
183  COMPLEX CDOTC
184  EXTERNAL lsame, icamax, slamch, cdotc
185 * ..
186 * .. External Subroutines ..
187  EXTERNAL caxpy, clacn2, clatbs, csrscl, xerbla
188 * ..
189 * .. Intrinsic Functions ..
190  INTRINSIC abs, aimag, min, real
191 * ..
192 * .. Statement Functions ..
193  REAL CABS1
194 * ..
195 * .. Statement Function definitions ..
196  cabs1( zdum ) = abs( real( zdum ) ) + abs( aimag( zdum ) )
197 * ..
198 * .. Executable Statements ..
199 *
200 * Test the input parameters.
201 *
202  info = 0
203  onenrm = norm.EQ.'1' .OR. lsame( norm, 'O' )
204  IF( .NOT.onenrm .AND. .NOT.lsame( norm, 'I' ) ) THEN
205  info = -1
206  ELSE IF( n.LT.0 ) THEN
207  info = -2
208  ELSE IF( kl.LT.0 ) THEN
209  info = -3
210  ELSE IF( ku.LT.0 ) THEN
211  info = -4
212  ELSE IF( ldab.LT.2*kl+ku+1 ) THEN
213  info = -6
214  ELSE IF( anorm.LT.zero ) THEN
215  info = -8
216  END IF
217  IF( info.NE.0 ) THEN
218  CALL xerbla( 'CGBCON', -info )
219  RETURN
220  END IF
221 *
222 * Quick return if possible
223 *
224  rcond = zero
225  IF( n.EQ.0 ) THEN
226  rcond = one
227  RETURN
228  ELSE IF( anorm.EQ.zero ) THEN
229  RETURN
230  END IF
231 *
232  smlnum = slamch( 'Safe minimum' )
233 *
234 * Estimate the norm of inv(A).
235 *
236  ainvnm = zero
237  normin = 'N'
238  IF( onenrm ) THEN
239  kase1 = 1
240  ELSE
241  kase1 = 2
242  END IF
243  kd = kl + ku + 1
244  lnoti = kl.GT.0
245  kase = 0
246  10 CONTINUE
247  CALL clacn2( n, work( n+1 ), work, ainvnm, kase, isave )
248  IF( kase.NE.0 ) THEN
249  IF( kase.EQ.kase1 ) THEN
250 *
251 * Multiply by inv(L).
252 *
253  IF( lnoti ) THEN
254  DO 20 j = 1, n - 1
255  lm = min( kl, n-j )
256  jp = ipiv( j )
257  t = work( jp )
258  IF( jp.NE.j ) THEN
259  work( jp ) = work( j )
260  work( j ) = t
261  END IF
262  CALL caxpy( lm, -t, ab( kd+1, j ), 1, work( j+1 ), 1 )
263  20 CONTINUE
264  END IF
265 *
266 * Multiply by inv(U).
267 *
268  CALL clatbs( 'Upper', 'No transpose', 'Non-unit', normin, n,
269  \$ kl+ku, ab, ldab, work, scale, rwork, info )
270  ELSE
271 *
272 * Multiply by inv(U**H).
273 *
274  CALL clatbs( 'Upper', 'Conjugate transpose', 'Non-unit',
275  \$ normin, n, kl+ku, ab, ldab, work, scale, rwork,
276  \$ info )
277 *
278 * Multiply by inv(L**H).
279 *
280  IF( lnoti ) THEN
281  DO 30 j = n - 1, 1, -1
282  lm = min( kl, n-j )
283  work( j ) = work( j ) - cdotc( lm, ab( kd+1, j ), 1,
284  \$ work( j+1 ), 1 )
285  jp = ipiv( j )
286  IF( jp.NE.j ) THEN
287  t = work( jp )
288  work( jp ) = work( j )
289  work( j ) = t
290  END IF
291  30 CONTINUE
292  END IF
293  END IF
294 *
295 * Divide X by 1/SCALE if doing so will not cause overflow.
296 *
297  normin = 'Y'
298  IF( scale.NE.one ) THEN
299  ix = icamax( n, work, 1 )
300  IF( scale.LT.cabs1( work( ix ) )*smlnum .OR. scale.EQ.zero )
301  \$ GO TO 40
302  CALL csrscl( n, scale, work, 1 )
303  END IF
304  GO TO 10
305  END IF
306 *
307 * Compute the estimate of the reciprocal condition number.
308 *
309  IF( ainvnm.NE.zero )
310  \$ rcond = ( one / ainvnm ) / anorm
311 *
312  40 CONTINUE
313  RETURN
314 *
315 * End of CGBCON
316 *
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:60
integer function icamax(N, CX, INCX)
ICAMAX
Definition: icamax.f:71
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:53
complex function cdotc(N, CX, INCX, CY, INCY)
CDOTC
Definition: cdotc.f:83
subroutine caxpy(N, CA, CX, INCX, CY, INCY)
CAXPY
Definition: caxpy.f:88
subroutine csrscl(N, SA, SX, INCX)
CSRSCL multiplies a vector by the reciprocal of a real scalar.
Definition: csrscl.f:84
subroutine clatbs(UPLO, TRANS, DIAG, NORMIN, N, KD, AB, LDAB, X, SCALE, CNORM, INFO)
CLATBS solves a triangular banded system of equations.
Definition: clatbs.f:243
subroutine clacn2(N, V, X, EST, KASE, ISAVE)
CLACN2 estimates the 1-norm of a square matrix, using reverse communication for evaluating matrix-vec...
Definition: clacn2.f:133
real function slamch(CMACH)
SLAMCH
Definition: slamch.f:68
Here is the call graph for this function:
Here is the caller graph for this function: