161 SUBROUTINE slaqtr( LTRAN, LREAL, N, T, LDT, B, W, SCALE, X,
175 REAL B( * ), T( LDT, * ), WORK( * ), X( * )
182 PARAMETER ( ZERO = 0.0e+0, one = 1.0e+0 )
186 INTEGER I, IERR, J, J1, J2, JNEXT, K, N1, N2
187 REAL BIGNUM, EPS, REC, SCALOC, SI, SMIN, SMINW,
188 $ smlnum, sr, tjj, tmp, xj, xmax, xnorm, z
191 REAL D( 2, 2 ), V( 2, 2 )
195 REAL SASUM, SDOT, SLAMCH, SLANGE
196 EXTERNAL isamax, sasum, sdot, slamch, slange
219 smlnum = slamch(
'S' ) / eps
220 bignum = one / smlnum
222 xnorm = slange(
'M', n, n, t, ldt, d )
224 $ xnorm = max( xnorm, abs( w ), slange(
'M', n, 1, b, n, d ) )
225 smin = max( smlnum, eps*xnorm )
232 work( j ) = sasum( j-1, t( 1, j ), 1 )
235 IF( .NOT.lreal )
THEN
237 work( i ) = work( i ) + abs( b( i ) )
245 k = isamax( n1, x, 1 )
249 IF( xmax.GT.bignum )
THEN
250 scale = bignum / xmax
251 CALL sscal( n1, scale, x, 1 )
269 IF( t( j, j-1 ).NE.zero )
THEN
283 tjj = abs( t( j1, j1 ) )
285 IF( tjj.LT.smin )
THEN
294 IF( tjj.LT.one )
THEN
295 IF( xj.GT.bignum*tjj )
THEN
297 CALL sscal( n, rec, x, 1 )
302 x( j1 ) = x( j1 ) / tmp
310 IF( work( j1 ).GT.( bignum-xmax )*rec )
THEN
311 CALL sscal( n, rec, x, 1 )
316 CALL saxpy( j1-1, -x( j1 ), t( 1, j1 ), 1, x,
318 k = isamax( j1-1, x, 1 )
331 CALL slaln2( .false., 2, 1, smin, one, t( j1, j1 ),
332 $ ldt, one, one, d, 2, zero, zero, v, 2,
333 $ scaloc, xnorm, ierr )
337 IF( scaloc.NE.one )
THEN
338 CALL sscal( n, scaloc, x, 1 )
347 xj = max( abs( v( 1, 1 ) ), abs( v( 2, 1 ) ) )
350 IF( max( work( j1 ), work( j2 ) ).GT.
351 $ ( bignum-xmax )*rec )
THEN
352 CALL sscal( n, rec, x, 1 )
360 CALL saxpy( j1-1, -x( j1 ), t( 1, j1 ), 1, x,
362 CALL saxpy( j1-1, -x( j2 ), t( 1, j2 ), 1, x,
364 k = isamax( j1-1, x, 1 )
384 IF( t( j+1, j ).NE.zero )
THEN
398 IF( xmax.GT.one )
THEN
400 IF( work( j1 ).GT.( bignum-xj )*rec )
THEN
401 CALL sscal( n, rec, x, 1 )
407 x( j1 ) = x( j1 ) - sdot( j1-1, t( 1, j1 ), 1, x,
411 tjj = abs( t( j1, j1 ) )
413 IF( tjj.LT.smin )
THEN
419 IF( tjj.LT.one )
THEN
420 IF( xj.GT.bignum*tjj )
THEN
422 CALL sscal( n, rec, x, 1 )
427 x( j1 ) = x( j1 ) / tmp
428 xmax = max( xmax, abs( x( j1 ) ) )
437 xj = max( abs( x( j1 ) ), abs( x( j2 ) ) )
438 IF( xmax.GT.one )
THEN
440 IF( max( work( j2 ), work( j1 ) ).GT.( bignum-xj )*
442 CALL sscal( n, rec, x, 1 )
448 d( 1, 1 ) = x( j1 ) - sdot( j1-1, t( 1, j1 ), 1, x,
450 d( 2, 1 ) = x( j2 ) - sdot( j1-1, t( 1, j2 ), 1, x,
453 CALL slaln2( .true., 2, 1, smin, one, t( j1, j1 ),
454 $ ldt, one, one, d, 2, zero, zero, v, 2,
455 $ scaloc, xnorm, ierr )
459 IF( scaloc.NE.one )
THEN
460 CALL sscal( n, scaloc, x, 1 )
465 xmax = max( abs( x( j1 ) ), abs( x( j2 ) ), xmax )
473 sminw = max( eps*abs( w ), smin )
486 IF( t( j, j-1 ).NE.zero )
THEN
501 xj = abs( x( j1 ) ) + abs( x( n+j1 ) )
502 tjj = abs( t( j1, j1 ) ) + abs( z )
504 IF( tjj.LT.sminw )
THEN
513 IF( tjj.LT.one )
THEN
514 IF( xj.GT.bignum*tjj )
THEN
516 CALL sscal( n2, rec, x, 1 )
521 CALL sladiv( x( j1 ), x( n+j1 ), tmp, z, sr, si )
524 xj = abs( x( j1 ) ) + abs( x( n+j1 ) )
531 IF( work( j1 ).GT.( bignum-xmax )*rec )
THEN
532 CALL sscal( n2, rec, x, 1 )
538 CALL saxpy( j1-1, -x( j1 ), t( 1, j1 ), 1, x,
540 CALL saxpy( j1-1, -x( n+j1 ), t( 1, j1 ), 1,
543 x( 1 ) = x( 1 ) + b( j1 )*x( n+j1 )
544 x( n+1 ) = x( n+1 ) - b( j1 )*x( j1 )
548 xmax = max( xmax, abs( x( k ) )+
559 d( 1, 2 ) = x( n+j1 )
560 d( 2, 2 ) = x( n+j2 )
561 CALL slaln2( .false., 2, 2, sminw, one, t( j1,
563 $ ldt, one, one, d, 2, zero, -w, v, 2,
564 $ scaloc, xnorm, ierr )
568 IF( scaloc.NE.one )
THEN
569 CALL sscal( 2*n, scaloc, x, 1 )
574 x( n+j1 ) = v( 1, 2 )
575 x( n+j2 ) = v( 2, 2 )
580 xj = max( abs( v( 1, 1 ) )+abs( v( 1, 2 ) ),
581 $ abs( v( 2, 1 ) )+abs( v( 2, 2 ) ) )
584 IF( max( work( j1 ), work( j2 ) ).GT.
585 $ ( bignum-xmax )*rec )
THEN
586 CALL sscal( n2, rec, x, 1 )
594 CALL saxpy( j1-1, -x( j1 ), t( 1, j1 ), 1, x,
596 CALL saxpy( j1-1, -x( j2 ), t( 1, j2 ), 1, x,
599 CALL saxpy( j1-1, -x( n+j1 ), t( 1, j1 ), 1,
601 CALL saxpy( j1-1, -x( n+j2 ), t( 1, j2 ), 1,
604 x( 1 ) = x( 1 ) + b( j1 )*x( n+j1 ) +
606 x( n+1 ) = x( n+1 ) - b( j1 )*x( j1 ) -
611 xmax = max( abs( x( k ) )+abs( x( k+n ) ),
631 IF( t( j+1, j ).NE.zero )
THEN
644 xj = abs( x( j1 ) ) + abs( x( j1+n ) )
645 IF( xmax.GT.one )
THEN
647 IF( work( j1 ).GT.( bignum-xj )*rec )
THEN
648 CALL sscal( n2, rec, x, 1 )
654 x( j1 ) = x( j1 ) - sdot( j1-1, t( 1, j1 ), 1, x,
656 x( n+j1 ) = x( n+j1 ) - sdot( j1-1, t( 1, j1 ), 1,
659 x( j1 ) = x( j1 ) - b( j1 )*x( n+1 )
660 x( n+j1 ) = x( n+j1 ) + b( j1 )*x( 1 )
662 xj = abs( x( j1 ) ) + abs( x( j1+n ) )
671 tjj = abs( t( j1, j1 ) ) + abs( z )
673 IF( tjj.LT.sminw )
THEN
679 IF( tjj.LT.one )
THEN
680 IF( xj.GT.bignum*tjj )
THEN
682 CALL sscal( n2, rec, x, 1 )
687 CALL sladiv( x( j1 ), x( n+j1 ), tmp, -z, sr, si )
690 xmax = max( abs( x( j1 ) )+abs( x( j1+n ) ), xmax )
699 xj = max( abs( x( j1 ) )+abs( x( n+j1 ) ),
700 $ abs( x( j2 ) )+abs( x( n+j2 ) ) )
701 IF( xmax.GT.one )
THEN
703 IF( max( work( j1 ), work( j2 ) ).GT.
704 $ ( bignum-xj ) / xmax )
THEN
705 CALL sscal( n2, rec, x, 1 )
711 d( 1, 1 ) = x( j1 ) - sdot( j1-1, t( 1, j1 ), 1, x,
713 d( 2, 1 ) = x( j2 ) - sdot( j1-1, t( 1, j2 ), 1, x,
715 d( 1, 2 ) = x( n+j1 ) - sdot( j1-1, t( 1, j1 ), 1,
717 d( 2, 2 ) = x( n+j2 ) - sdot( j1-1, t( 1, j2 ), 1,
719 d( 1, 1 ) = d( 1, 1 ) - b( j1 )*x( n+1 )
720 d( 2, 1 ) = d( 2, 1 ) - b( j2 )*x( n+1 )
721 d( 1, 2 ) = d( 1, 2 ) + b( j1 )*x( 1 )
722 d( 2, 2 ) = d( 2, 2 ) + b( j2 )*x( 1 )
724 CALL slaln2( .true., 2, 2, sminw, one, t( j1, j1 ),
725 $ ldt, one, one, d, 2, zero, w, v, 2,
726 $ scaloc, xnorm, ierr )
730 IF( scaloc.NE.one )
THEN
731 CALL sscal( n2, scaloc, x, 1 )
736 x( n+j1 ) = v( 1, 2 )
737 x( n+j2 ) = v( 2, 2 )
738 xmax = max( abs( x( j1 ) )+abs( x( n+j1 ) ),
739 $ abs( x( j2 ) )+abs( x( n+j2 ) ), xmax )