1 SUBROUTINE sdbtrf( 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( nbmax = 64, ldwork = nbmax+1 )
93 INTEGER I, I2, I3, II, J, J2, J3, JB, JJ, JM, JP,
97 REAL WORK13( LDWORK, NBMAX ),
98 $ WORK31( LDWORK, NBMAX )
101 INTEGER ILAENV, ISAMAX
102 EXTERNAL ilaenv, isamax
105 EXTERNAL scopy,
sdbtf2, sgemm, sger, sscal,
106 $ sswap, strsm, 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(
'SDBTRF', -info )
138 IF( m.EQ.0 .OR. n.EQ.0 )
143 nb = ilaenv( 1,
'SDBTRF',
' ', m, n, kl, ku )
148 nb =
min( nb, nbmax )
150 IF( nb.LE.1 .OR. nb.GT.kl )
THEN
154 CALL sdbtf2( 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 sscal( km, one / ab( kv+1, jj ), ab( kv+2, jj ),
221 jm =
min( ju, j+jb-1 )
223 CALL sger( 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 scopy( 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 strsm(
'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 sgemm(
'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 sgemm(
'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 strsm(
'Left',
'Lower',
'No transpose',
'Unit',
288 $ jb, j3, one, ab( kv+1, j ), ldab-1,
295 CALL sgemm(
'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 sgemm(
'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 scopy( nw, work31( 1, jj-j+1 ), 1,
330 $ ab( kv+kl+1-jj+j, jj ), 1 )