1 SUBROUTINE cdbtrf( M, N, KL, KU, AB, LDAB, INFO )
15 INTEGER INFO, KL, KU, LDAB, M, N
87 parameter( one = 1.0e+0 )
88 parameter( zero = 0.0e+0 )
90 parameter( cone = ( 1.0e+0, 0.0e+0 ) )
91 parameter( czero = ( 0.0e+0, 0.0e+0 ) )
93 parameter( nbmax = 64, ldwork = nbmax+1 )
96 INTEGER I, I2, I3, II, J, J2, J3, JB, JJ, JM, JP,
100 COMPLEX WORK13( LDWORK, NBMAX ),
101 $ WORK31( LDWORK, NBMAX )
104 INTEGER ILAENV, ISAMAX
105 EXTERNAL ilaenv, isamax
108 EXTERNAL ccopy,
cdbtf2, cgemm, cgeru, cscal,
109 $ cswap, ctrsm, xerbla
125 ELSE IF( n.LT.0 )
THEN
127 ELSE IF( kl.LT.0 )
THEN
129 ELSE IF( ku.LT.0 )
THEN
131 ELSE IF( ldab.LT.
min(
min( kl+kv+1,m ),n ) )
THEN
135 CALL xerbla(
'CDBTRF', -info )
141 IF( m.EQ.0 .OR. n.EQ.0 )
146 nb = ilaenv( 1,
'CDBTRF',
' ', m, n, kl, ku )
151 nb =
min( nb, nbmax )
153 IF( nb.LE.1 .OR. nb.GT.kl )
THEN
157 CALL cdbtf2( m, n, kl, ku, ab, ldab, info )
166 work13( i, j ) = zero
174 work31( i, j ) = zero
183 DO 180 j = 1,
min( m, n ), nb
184 jb =
min( nb,
min( m, n )-j+1 )
198 i2 =
min( kl-jb, m-j-jb+1 )
199 i3 =
min( jb, m-j-kl+1 )
205 DO 80 jj = j, j + jb - 1
212 IF( ab( kv+jp, jj ).NE.zero )
THEN
213 ju =
max( ju,
min( jj+ku+jp-1, n ) )
217 CALL cscal( km, one / ab( kv+1, jj ), ab( kv+2, jj ),
224 jm =
min( ju, j+jb-1 )
226 CALL cgeru( km, jm-jj, -cone, ab( kv+2, jj ), 1,
227 $ ab( kv, jj+1 ), ldab-1,
228 $ ab( kv+1, jj+1 ), ldab-1 )
234 nw =
min( jj-j+1, i3 )
236 $
CALL ccopy( nw, ab( kv+kl+1-jj+j, jj ), 1,
237 $ work31( 1, jj-j+1 ), 1 )
243 j2 =
min( ju-j+1, kv ) - jb
244 j3 =
max( 0, ju-j-kv+1 )
252 CALL ctrsm(
'Left',
'Lower',
'No transpose',
'Unit',
253 $ jb, j2, cone, ab( kv+1, j ), ldab-1,
254 $ ab( kv+1-jb, j+jb ), ldab-1 )
260 CALL cgemm(
'No transpose',
'No transpose', i2, j2,
261 $ jb, -cone, ab( kv+1+jb, j ), ldab-1,
262 $ ab( kv+1-jb, j+jb ), ldab-1, cone,
263 $ ab( kv+1, j+jb ), ldab-1 )
270 CALL cgemm(
'No transpose',
'No transpose', i3, j2,
271 $ jb, -cone, work31, ldwork,
272 $ ab( kv+1-jb, j+jb ), ldab-1, cone,
273 $ ab( kv+kl+1-jb, j+jb ), ldab-1 )
284 work13( ii, jj ) = ab( ii-jj+1, jj+j+kv-1 )
290 CALL ctrsm(
'Left',
'Lower',
'No transpose',
'Unit',
291 $ jb, j3, cone, ab( kv+1, j ), ldab-1,
298 CALL cgemm(
'No transpose',
'No transpose', i2, j3,
299 $ jb, -cone, ab( kv+1+jb, j ), ldab-1,
300 $ work13, ldwork, cone, ab( 1+jb, j+kv ),
308 CALL cgemm(
'No transpose',
'No transpose', i3, j3,
309 $ jb, -cone, work31, ldwork, work13,
310 $ ldwork, cone, ab( 1+kl, j+kv ), ldab-1 )
317 ab( ii-jj+1, jj+j+kv-1 ) = work13( ii, jj )
326 DO 170 jj = j + jb - 1, j, -1
330 nw =
min( i3, jj-j+1 )
332 $
CALL ccopy( nw, work31( 1, jj-j+1 ), 1,
333 $ ab( kv+kl+1-jj+j, jj ), 1 )