1 SUBROUTINE bdtrexc( N, T, LDT, IFST, ILST, NITRAF, ITRAF,
2 $ NDTRAF, DTRAF, WORK, INFO )
12 INTEGER IFST, ILST, INFO, LDT, N, NDTRAF, NITRAF
16 DOUBLE PRECISION DTRAF( * ), T( LDT, * ), WORK( * )
131 DOUBLE PRECISION ZERO
132 parameter( zero = 0.0d+0 )
133 INTEGER DLNGTH(3), ILNGTH(3)
136 INTEGER CDTRAF, CITRAF, LDTRAF, LITRAF, HERE, I, NBF,
151 DATA ilngth(1)/1/, ilngth(2)/2/, ilngth(3)/4/
152 DATA dlngth(1)/2/, dlngth(2)/5/, dlngth(3)/10/
161 ELSE IF( ldt.LT.
max( 1, n ) )
THEN
163 ELSE IF( ifst.LT.1 .OR. ifst.GT.n )
THEN
165 ELSE IF( ilst.LT.1 .OR. ilst.GT.n )
THEN
167 ELSE IF ( nitraf.LT.
max( 1, abs( ilst-ifst ) ) )
THEN
169 ELSE IF ( ndtraf.LT.
max( 1, 2*abs( ilst-ifst ) ) )
THEN
173 CALL xerbla(
'DTREXC', -info )
188 IF( t( ifst, ifst-1 ).NE.zero )
193 IF( t( ifst+1, ifst ).NE.zero )
201 IF( t( ilst, ilst-1 ).NE.zero )
206 IF( t( ilst+1, ilst ).NE.zero )
213 IF( ifst.LT.ilst )
THEN
217 IF( nbf.EQ.2 .AND. nbl.EQ.1 )
219 IF( nbf.EQ.1 .AND. nbl.EQ.2 )
228 IF( nbf.EQ.1 .OR. nbf.EQ.2 )
THEN
233 IF( here+nbf+1.LE.n )
THEN
234 IF( t( here+nbf+1, here+nbf ).NE.zero )
238 litraf = ilngth(nbf+nbnext-1)
239 ldtraf = dlngth(nbf+nbnext-1)
240 IF( citraf+litraf-1.GT.nitraf )
THEN
242 CALL xerbla(
'BDTREXC', -info )
245 IF( cdtraf+ldtraf-1.GT.ndtraf )
THEN
247 CALL xerbla(
'BDTREXC', -info )
250 CALL bdlaexc( n, t, ldt, here, nbf, nbnext, itraf(citraf),
251 $ dtraf(cdtraf), work, info )
258 citraf = citraf + litraf
259 cdtraf = cdtraf + ldtraf
265 IF( t( here+1, here ).EQ.zero )
275 IF( here+3.LE.n )
THEN
276 IF( t( here+3, here+2 ).NE.zero )
279 litraf = ilngth(nbnext)
280 ldtraf = dlngth(nbnext)
281 IF( citraf+litraf-1.GT.nitraf )
THEN
283 CALL xerbla(
'BDTREXC', -info )
286 IF( cdtraf+ldtraf-1.GT.ndtraf )
THEN
288 CALL xerbla(
'BDTREXC', -info )
291 CALL bdlaexc( n, t, ldt, here+1, 1, nbnext, itraf(citraf),
292 $ dtraf(cdtraf), work, info )
299 citraf = citraf + litraf
300 cdtraf = cdtraf + ldtraf
302 IF( nbnext.EQ.1 )
THEN
308 IF( citraf+litraf-1.GT.nitraf )
THEN
310 CALL xerbla(
'BDTREXC', -info )
313 IF( cdtraf+ldtraf-1.GT.ndtraf )
THEN
315 CALL xerbla(
'BDTREXC', -info )
318 CALL bdlaexc( n, t, ldt, here, 1, nbnext, itraf(citraf),
319 $ dtraf(cdtraf), work, info )
320 citraf = citraf + litraf
321 cdtraf = cdtraf + ldtraf
327 IF( t( here+2, here+1 ).EQ.zero )
329 IF( nbnext.EQ.2 )
THEN
335 IF( citraf+litraf-1.GT.nitraf )
THEN
337 CALL xerbla(
'BDTREXC', -info )
340 IF( cdtraf+ldtraf-1.GT.ndtraf )
THEN
342 CALL xerbla(
'BDTREXC', -info )
345 CALL bdlaexc( n, t, ldt, here, 1, nbnext,
346 $ itraf(citraf), dtraf(cdtraf), work,
355 citraf = citraf + litraf
356 cdtraf = cdtraf + ldtraf
364 IF( citraf+2*litraf-1.GT.nitraf )
THEN
366 CALL xerbla(
'BDTREXC', -info )
369 IF( cdtraf+2*ldtraf-1.GT.ndtraf )
THEN
371 CALL xerbla(
'BDTREXC', -info )
374 CALL bdlaexc( n, t, ldt, here, 1, 1, itraf(citraf),
375 $ dtraf(cdtraf), work, info )
376 citraf = citraf + litraf
377 cdtraf = cdtraf + ldtraf
378 CALL bdlaexc( n, t, ldt, here+1, 1, 1, itraf(citraf),
379 $ dtraf(cdtraf), work, info )
380 citraf = citraf + litraf
381 cdtraf = cdtraf + ldtraf
396 IF( nbf.EQ.1 .OR. nbf.EQ.2 )
THEN
402 IF( t( here-1, here-2 ).NE.zero )
406 litraf = ilngth(nbf+nbnext-1)
407 ldtraf = dlngth(nbf+nbnext-1)
408 IF( citraf+litraf-1.GT.nitraf )
THEN
410 CALL xerbla(
'BDTREXC', -info )
413 IF( cdtraf+ldtraf-1.GT.ndtraf )
THEN
415 CALL xerbla(
'BDTREXC', -info )
418 CALL bdlaexc( n, t, ldt, here-nbnext, nbnext, nbf,
419 $ itraf(citraf), dtraf(cdtraf), work, info )
426 citraf = citraf + litraf
427 cdtraf = cdtraf + ldtraf
433 IF( t( here+1, here ).EQ.zero )
444 IF( t( here-1, here-2 ).NE.zero )
447 litraf = ilngth(nbnext)
448 ldtraf = dlngth(nbnext)
449 IF( citraf+litraf-1.GT.nitraf )
THEN
451 CALL xerbla(
'BDTREXC', -info )
454 IF( cdtraf+ldtraf-1.GT.ndtraf )
THEN
456 CALL xerbla(
'BDTREXC', -info )
459 CALL bdlaexc( n, t, ldt, here-nbnext, nbnext, 1,
460 $ itraf(citraf), dtraf(cdtraf), work, info )
467 citraf = citraf + litraf
468 cdtraf = cdtraf + ldtraf
470 IF( nbnext.EQ.1 )
THEN
476 IF( citraf+litraf-1.GT.nitraf )
THEN
478 CALL xerbla(
'BDTREXC', -info )
481 IF( cdtraf+ldtraf-1.GT.ndtraf )
THEN
483 CALL xerbla(
'BDTREXC', -info )
486 CALL bdlaexc( n, t, ldt, here, nbnext, 1, itraf(citraf),
487 $ dtraf(cdtraf), work, info )
488 citraf = citraf + litraf
489 cdtraf = cdtraf + ldtraf
495 IF( t( here, here-1 ).EQ.zero )
497 IF( nbnext.EQ.2 )
THEN
503 IF( citraf+litraf-1.GT.nitraf )
THEN
505 CALL xerbla(
'BDTREXC', -info )
508 IF( cdtraf+ldtraf-1.GT.ndtraf )
THEN
510 CALL xerbla(
'BDTREXC', -info )
513 CALL bdlaexc( n, t, ldt, here-1, 2, 1, itraf(citraf),
514 $ dtraf(cdtraf), work, info )
522 citraf = citraf + litraf
523 cdtraf = cdtraf + ldtraf
531 IF( citraf+2*litraf-1.GT.nitraf )
THEN
533 CALL xerbla(
'BDTREXC', -info )
536 IF( cdtraf+2*ldtraf-1.GT.ndtraf )
THEN
538 CALL xerbla(
'BDTREXC', -info )
541 CALL bdlaexc( n, t, ldt, here, 1, 1, itraf(citraf),
542 $ dtraf(cdtraf), work, info )
543 citraf = citraf + litraf
544 cdtraf = cdtraf + ldtraf
545 CALL bdlaexc( n, t, ldt, here-1, 1, 1, itraf(citraf),
546 $ dtraf(cdtraf), work, info )
547 citraf = citraf + litraf
548 cdtraf = cdtraf + ldtraf