143 SUBROUTINE cgbtrf( M, N, KL, KU, AB, LDAB, IPIV, INFO )
150 INTEGER INFO, KL, KU, LDAB, M, N
154 COMPLEX AB( LDAB, * )
161 parameter( one = ( 1.0e+0, 0.0e+0 ),
162 $ zero = ( 0.0e+0, 0.0e+0 ) )
163 INTEGER NBMAX, LDWORK
164 parameter( nbmax = 64, ldwork = nbmax+1 )
167 INTEGER I, I2, I3, II, IP, J, J2, J3, JB, JJ, JM, JP,
168 $ JU, K2, KM, KV, NB, NW
172 COMPLEX WORK13( LDWORK, NBMAX ),
173 $ WORK31( LDWORK, NBMAX )
176 INTEGER ICAMAX, ILAENV
177 EXTERNAL icamax, ilaenv
198 ELSE IF( n.LT.0 )
THEN
200 ELSE IF( kl.LT.0 )
THEN
202 ELSE IF( ku.LT.0 )
THEN
204 ELSE IF( ldab.LT.kl+kv+1 )
THEN
208 CALL xerbla(
'CGBTRF', -info )
214 IF( m.EQ.0 .OR. n.EQ.0 )
219 nb = ilaenv( 1,
'CGBTRF',
' ', m, n, kl, ku )
224 nb = min( nb, nbmax )
226 IF( nb.LE.1 .OR. nb.GT.kl )
THEN
230 CALL cgbtf2( m, n, kl, ku, ab, ldab, ipiv, info )
239 work13( i, j ) = zero
247 work31( i, j ) = zero
255 DO 60 j = ku + 2, min( kv, n )
256 DO 50 i = kv - j + 2, kl
266 DO 180 j = 1, min( m, n ), nb
267 jb = min( nb, min( m, n )-j+1 )
281 i2 = min( kl-jb, m-j-jb+1 )
282 i3 = min( jb, m-j-kl+1 )
288 DO 80 jj = j, j + jb - 1
292 IF( jj+kv.LE.n )
THEN
294 ab( i, jj+kv ) = zero
302 jp = icamax( km+1, ab( kv+1, jj ), 1 )
303 ipiv( jj ) = jp + jj - j
304 IF( ab( kv+jp, jj ).NE.zero )
THEN
305 ju = max( ju, min( jj+ku+jp-1, n ) )
310 IF( jp+jj-1.LT.j+kl )
THEN
312 CALL cswap( jb, ab( kv+1+jj-j, j ), ldab-1,
313 $ ab( kv+jp+jj-j, j ), ldab-1 )
319 CALL cswap( jj-j, ab( kv+1+jj-j, j ), ldab-1,
320 $ work31( jp+jj-j-kl, 1 ), ldwork )
321 CALL cswap( j+jb-jj, ab( kv+1, jj ), ldab-1,
322 $ ab( kv+jp, jj ), ldab-1 )
328 CALL cscal( km, one / ab( kv+1, jj ), ab( kv+2, jj ),
335 jm = min( ju, j+jb-1 )
337 $
CALL cgeru( km, jm-jj, -one, ab( kv+2, jj ), 1,
338 $ ab( kv, jj+1 ), ldab-1,
339 $ ab( kv+1, jj+1 ), ldab-1 )
351 nw = min( jj-j+1, i3 )
353 $
CALL ccopy( nw, ab( kv+kl+1-jj+j, jj ), 1,
354 $ work31( 1, jj-j+1 ), 1 )
360 j2 = min( ju-j+1, kv ) - jb
361 j3 = max( 0, ju-j-kv+1 )
366 CALL claswp( j2, ab( kv+1-jb, j+jb ), ldab-1, 1, jb,
371 DO 90 i = j, j + jb - 1
372 ipiv( i ) = ipiv( i ) + j - 1
381 DO 100 ii = j + i - 1, j + jb - 1
384 temp = ab( kv+1+ii-jj, jj )
385 ab( kv+1+ii-jj, jj ) = ab( kv+1+ip-jj, jj )
386 ab( kv+1+ip-jj, jj ) = temp
397 CALL ctrsm(
'Left',
'Lower',
'No transpose',
'Unit',
398 $ jb, j2, one, ab( kv+1, j ), ldab-1,
399 $ ab( kv+1-jb, j+jb ), ldab-1 )
405 CALL cgemm(
'No transpose',
'No transpose', i2, j2,
406 $ jb, -one, ab( kv+1+jb, j ), ldab-1,
407 $ ab( kv+1-jb, j+jb ), ldab-1, one,
408 $ ab( kv+1, j+jb ), ldab-1 )
415 CALL cgemm(
'No transpose',
'No transpose', i3, j2,
416 $ jb, -one, work31, ldwork,
417 $ ab( kv+1-jb, j+jb ), ldab-1, one,
418 $ ab( kv+kl+1-jb, j+jb ), ldab-1 )
429 work13( ii, jj ) = ab( ii-jj+1, jj+j+kv-1 )
435 CALL ctrsm(
'Left',
'Lower',
'No transpose',
'Unit',
436 $ jb, j3, one, ab( kv+1, j ), ldab-1,
443 CALL cgemm(
'No transpose',
'No transpose', i2, j3,
444 $ jb, -one, ab( kv+1+jb, j ), ldab-1,
445 $ work13, ldwork, one, ab( 1+jb, j+kv ),
453 CALL cgemm(
'No transpose',
'No transpose', i3, j3,
454 $ jb, -one, work31, ldwork, work13,
455 $ ldwork, one, ab( 1+kl, j+kv ), ldab-1 )
462 ab( ii-jj+1, jj+j+kv-1 ) = work13( ii, jj )
470 DO 160 i = j, j + jb - 1
471 ipiv( i ) = ipiv( i ) + j - 1
479 DO 170 jj = j + jb - 1, j, -1
480 jp = ipiv( jj ) - jj + 1
485 IF( jp+jj-1.LT.j+kl )
THEN
489 CALL cswap( jj-j, ab( kv+1+jj-j, j ), ldab-1,
490 $ ab( kv+jp+jj-j, j ), ldab-1 )
495 CALL cswap( jj-j, ab( kv+1+jj-j, j ), ldab-1,
496 $ work31( jp+jj-j-kl, 1 ), ldwork )
502 nw = min( i3, jj-j+1 )
504 $
CALL ccopy( nw, work31( 1, jj-j+1 ), 1,
505 $ ab( kv+kl+1-jj+j, jj ), 1 )
subroutine xerbla(srname, info)
subroutine ccopy(n, cx, incx, cy, incy)
CCOPY
subroutine cgbtf2(m, n, kl, ku, ab, ldab, ipiv, info)
CGBTF2 computes the LU factorization of a general band matrix using the unblocked version of the algo...
subroutine cgbtrf(m, n, kl, ku, ab, ldab, ipiv, info)
CGBTRF
subroutine cgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
CGEMM
subroutine cgeru(m, n, alpha, x, incx, y, incy, a, lda)
CGERU
subroutine claswp(n, a, lda, k1, k2, ipiv, incx)
CLASWP performs a series of row interchanges on a general rectangular matrix.
subroutine cscal(n, ca, cx, incx)
CSCAL
subroutine cswap(n, cx, incx, cy, incy)
CSWAP
subroutine ctrsm(side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb)
CTRSM