1 SUBROUTINE ddbtrf( M, N, KL, KU, AB, LDAB, INFO )
15 INTEGER INFO, KL, KU, LDAB, M, N
18 DOUBLE PRECISION AB( LDAB, * )
86 DOUBLE PRECISION ONE, ZERO
87 parameter( one = 1.0d+0 )
88 parameter( zero = 0.0d+0 )
90 parameter( nbmax = 64, ldwork = nbmax+1 )
93 INTEGER I, I2, I3, II, J, J2, J3, JB, JJ, JM, JP,
97 DOUBLE PRECISION WORK13( LDWORK, NBMAX ),
98 $ WORK31( LDWORK, NBMAX )
101 INTEGER ILAENV, ISAMAX
102 EXTERNAL ilaenv, isamax
105 EXTERNAL dcopy,
ddbtf2, dgemm, dger, dscal,
106 $ dswap, dtrsm, xerbla
122 ELSE IF( n.LT.0 )
THEN
124 ELSE IF( kl.LT.0 )
THEN
126 ELSE IF( ku.LT.0 )
THEN
128 ELSE IF( ldab.LT.
min(
min( kl+kv+1,m ),n ) )
THEN
132 CALL xerbla(
'DDBTRF', -info )
138 IF( m.EQ.0 .OR. n.EQ.0 )
143 nb = ilaenv( 1,
'DDBTRF',
' ', m, n, kl, ku )
148 nb =
min( nb, nbmax )
150 IF( nb.LE.1 .OR. nb.GT.kl )
THEN
154 CALL ddbtf2( m, n, kl, ku, ab, ldab, info )
163 work13( i, j ) = zero
171 work31( i, j ) = zero
180 DO 180 j = 1,
min( m, n ), nb
181 jb =
min( nb,
min( m, n )-j+1 )
195 i2 =
min( kl-jb, m-j-jb+1 )
196 i3 =
min( jb, m-j-kl+1 )
202 DO 80 jj = j, j + jb - 1
209 IF( ab( kv+jp, jj ).NE.zero )
THEN
210 ju =
max( ju,
min( jj+ku+jp-1, n ) )
214 CALL dscal( km, one / ab( kv+1, jj ), ab( kv+2, jj ),
221 jm =
min( ju, j+jb-1 )
223 CALL dger( km, jm-jj, -one, ab( kv+2, jj ), 1,
224 $ ab( kv, jj+1 ), ldab-1,
225 $ ab( kv+1, jj+1 ), ldab-1 )
231 nw =
min( jj-j+1, i3 )
233 $
CALL dcopy( nw, ab( kv+kl+1-jj+j, jj ), 1,
234 $ work31( 1, jj-j+1 ), 1 )
240 j2 =
min( ju-j+1, kv ) - jb
241 j3 =
max( 0, ju-j-kv+1 )
249 CALL dtrsm(
'Left',
'Lower',
'No transpose',
'Unit',
250 $ jb, j2, one, ab( kv+1, j ), ldab-1,
251 $ ab( kv+1-jb, j+jb ), ldab-1 )
257 CALL dgemm(
'No transpose',
'No transpose', i2, j2,
258 $ jb, -one, ab( kv+1+jb, j ), ldab-1,
259 $ ab( kv+1-jb, j+jb ), ldab-1, one,
260 $ ab( kv+1, j+jb ), ldab-1 )
267 CALL dgemm(
'No transpose',
'No transpose', i3, j2,
268 $ jb, -one, work31, ldwork,
269 $ ab( kv+1-jb, j+jb ), ldab-1, one,
270 $ ab( kv+kl+1-jb, j+jb ), ldab-1 )
281 work13( ii, jj ) = ab( ii-jj+1, jj+j+kv-1 )
287 CALL dtrsm(
'Left',
'Lower',
'No transpose',
'Unit',
288 $ jb, j3, one, ab( kv+1, j ), ldab-1,
295 CALL dgemm(
'No transpose',
'No transpose', i2, j3,
296 $ jb, -one, ab( kv+1+jb, j ), ldab-1,
297 $ work13, ldwork, one, ab( 1+jb, j+kv ),
305 CALL dgemm(
'No transpose',
'No transpose', i3, j3,
306 $ jb, -one, work31, ldwork, work13,
307 $ ldwork, one, ab( 1+kl, j+kv ), ldab-1 )
314 ab( ii-jj+1, jj+j+kv-1 ) = work13( ii, jj )
323 DO 170 jj = j + jb - 1, j, -1
327 nw =
min( i3, jj-j+1 )
329 $
CALL dcopy( nw, work31( 1, jj-j+1 ), 1,
330 $ ab( kv+kl+1-jj+j, jj ), 1 )