163 SUBROUTINE dlaqtr( LTRAN, LREAL, N, T, LDT, B, W, SCALE, X, WORK,
173 DOUBLE PRECISION SCALE, W
176 DOUBLE PRECISION B( * ), T( LDT, * ), WORK( * ), X( * )
182 DOUBLE PRECISION ZERO, ONE
183 parameter( zero = 0.0d+0, one = 1.0d+0 )
187 INTEGER I, IERR, J, J1, J2, JNEXT, K, N1, N2
188 DOUBLE PRECISION BIGNUM, EPS, REC, SCALOC, SI, SMIN, SMINW,
189 $ smlnum, sr, tjj, tmp, xj, xmax, xnorm, z
192 DOUBLE PRECISION D( 2, 2 ), V( 2, 2 )
196 DOUBLE PRECISION DASUM, DDOT, DLAMCH, DLANGE
197 EXTERNAL idamax, dasum, ddot, dlamch, dlange
220 smlnum = dlamch(
'S' ) / eps
221 bignum = one / smlnum
223 xnorm = dlange(
'M', n, n, t, ldt, d )
225 $ xnorm = max( xnorm, abs( w ), dlange(
'M', n, 1, b, n, d ) )
226 smin = max( smlnum, eps*xnorm )
233 work( j ) = dasum( j-1, t( 1, j ), 1 )
236 IF( .NOT.lreal )
THEN
238 work( i ) = work( i ) + abs( b( i ) )
246 k = idamax( n1, x, 1 )
250 IF( xmax.GT.bignum )
THEN
251 scale = bignum / xmax
252 CALL dscal( n1, scale, x, 1 )
270 IF( t( j, j-1 ).NE.zero )
THEN
284 tjj = abs( t( j1, j1 ) )
286 IF( tjj.LT.smin )
THEN
295 IF( tjj.LT.one )
THEN
296 IF( xj.GT.bignum*tjj )
THEN
298 CALL dscal( n, rec, x, 1 )
303 x( j1 ) = x( j1 ) / tmp
311 IF( work( j1 ).GT.( bignum-xmax )*rec )
THEN
312 CALL dscal( n, rec, x, 1 )
317 CALL daxpy( j1-1, -x( j1 ), t( 1, j1 ), 1, x, 1 )
318 k = idamax( j1-1, x, 1 )
331 CALL dlaln2( .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 dscal( 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 dscal( n, rec, x, 1 )
360 CALL daxpy( j1-1, -x( j1 ), t( 1, j1 ), 1, x, 1 )
361 CALL daxpy( j1-1, -x( j2 ), t( 1, j2 ), 1, x, 1 )
362 k = idamax( j1-1, x, 1 )
382 IF( t( j+1, j ).NE.zero )
THEN
396 IF( xmax.GT.one )
THEN
398 IF( work( j1 ).GT.( bignum-xj )*rec )
THEN
399 CALL dscal( n, rec, x, 1 )
405 x( j1 ) = x( j1 ) - ddot( j1-1, t( 1, j1 ), 1, x, 1 )
408 tjj = abs( t( j1, j1 ) )
410 IF( tjj.LT.smin )
THEN
416 IF( tjj.LT.one )
THEN
417 IF( xj.GT.bignum*tjj )
THEN
419 CALL dscal( n, rec, x, 1 )
424 x( j1 ) = x( j1 ) / tmp
425 xmax = max( xmax, abs( x( j1 ) ) )
434 xj = max( abs( x( j1 ) ), abs( x( j2 ) ) )
435 IF( xmax.GT.one )
THEN
437 IF( max( work( j2 ), work( j1 ) ).GT.( bignum-xj )*
439 CALL dscal( n, rec, x, 1 )
445 d( 1, 1 ) = x( j1 ) - ddot( j1-1, t( 1, j1 ), 1, x,
447 d( 2, 1 ) = x( j2 ) - ddot( j1-1, t( 1, j2 ), 1, x,
450 CALL dlaln2( .true., 2, 1, smin, one, t( j1, j1 ),
451 $ ldt, one, one, d, 2, zero, zero, v, 2,
452 $ scaloc, xnorm, ierr )
456 IF( scaloc.NE.one )
THEN
457 CALL dscal( n, scaloc, x, 1 )
462 xmax = max( abs( x( j1 ) ), abs( x( j2 ) ), xmax )
470 sminw = max( eps*abs( w ), smin )
483 IF( t( j, j-1 ).NE.zero )
THEN
498 xj = abs( x( j1 ) ) + abs( x( n+j1 ) )
499 tjj = abs( t( j1, j1 ) ) + abs( z )
501 IF( tjj.LT.sminw )
THEN
510 IF( tjj.LT.one )
THEN
511 IF( xj.GT.bignum*tjj )
THEN
513 CALL dscal( n2, rec, x, 1 )
518 CALL dladiv( x( j1 ), x( n+j1 ), tmp, z, sr, si )
521 xj = abs( x( j1 ) ) + abs( x( n+j1 ) )
528 IF( work( j1 ).GT.( bignum-xmax )*rec )
THEN
529 CALL dscal( n2, rec, x, 1 )
535 CALL daxpy( j1-1, -x( j1 ), t( 1, j1 ), 1, x, 1 )
536 CALL daxpy( j1-1, -x( n+j1 ), t( 1, j1 ), 1,
539 x( 1 ) = x( 1 ) + b( j1 )*x( n+j1 )
540 x( n+1 ) = x( n+1 ) - b( j1 )*x( j1 )
544 xmax = max( xmax, abs( x( k ) )+
555 d( 1, 2 ) = x( n+j1 )
556 d( 2, 2 ) = x( n+j2 )
557 CALL dlaln2( .false., 2, 2, sminw, one, t( j1, j1 ),
558 $ ldt, one, one, d, 2, zero, -w, v, 2,
559 $ scaloc, xnorm, ierr )
563 IF( scaloc.NE.one )
THEN
564 CALL dscal( 2*n, scaloc, x, 1 )
569 x( n+j1 ) = v( 1, 2 )
570 x( n+j2 ) = v( 2, 2 )
575 xj = max( abs( v( 1, 1 ) )+abs( v( 1, 2 ) ),
576 $ abs( v( 2, 1 ) )+abs( v( 2, 2 ) ) )
579 IF( max( work( j1 ), work( j2 ) ).GT.
580 $ ( bignum-xmax )*rec )
THEN
581 CALL dscal( n2, rec, x, 1 )
589 CALL daxpy( j1-1, -x( j1 ), t( 1, j1 ), 1, x, 1 )
590 CALL daxpy( j1-1, -x( j2 ), t( 1, j2 ), 1, x, 1 )
592 CALL daxpy( j1-1, -x( n+j1 ), t( 1, j1 ), 1,
594 CALL daxpy( j1-1, -x( n+j2 ), t( 1, j2 ), 1,
597 x( 1 ) = x( 1 ) + b( j1 )*x( n+j1 ) +
599 x( n+1 ) = x( n+1 ) - b( j1 )*x( j1 ) -
604 xmax = max( abs( x( k ) )+abs( x( k+n ) ),
624 IF( t( j+1, j ).NE.zero )
THEN
637 xj = abs( x( j1 ) ) + abs( x( j1+n ) )
638 IF( xmax.GT.one )
THEN
640 IF( work( j1 ).GT.( bignum-xj )*rec )
THEN
641 CALL dscal( n2, rec, x, 1 )
647 x( j1 ) = x( j1 ) - ddot( j1-1, t( 1, j1 ), 1, x, 1 )
648 x( n+j1 ) = x( n+j1 ) - ddot( j1-1, t( 1, j1 ), 1,
651 x( j1 ) = x( j1 ) - b( j1 )*x( n+1 )
652 x( n+j1 ) = x( n+j1 ) + b( j1 )*x( 1 )
654 xj = abs( x( j1 ) ) + abs( x( j1+n ) )
663 tjj = abs( t( j1, j1 ) ) + abs( z )
665 IF( tjj.LT.sminw )
THEN
671 IF( tjj.LT.one )
THEN
672 IF( xj.GT.bignum*tjj )
THEN
674 CALL dscal( n2, rec, x, 1 )
679 CALL dladiv( x( j1 ), x( n+j1 ), tmp, -z, sr, si )
682 xmax = max( abs( x( j1 ) )+abs( x( j1+n ) ), xmax )
691 xj = max( abs( x( j1 ) )+abs( x( n+j1 ) ),
692 $ abs( x( j2 ) )+abs( x( n+j2 ) ) )
693 IF( xmax.GT.one )
THEN
695 IF( max( work( j1 ), work( j2 ) ).GT.
696 $ ( bignum-xj ) / xmax )
THEN
697 CALL dscal( n2, rec, x, 1 )
703 d( 1, 1 ) = x( j1 ) - ddot( j1-1, t( 1, j1 ), 1, x,
705 d( 2, 1 ) = x( j2 ) - ddot( j1-1, t( 1, j2 ), 1, x,
707 d( 1, 2 ) = x( n+j1 ) - ddot( j1-1, t( 1, j1 ), 1,
709 d( 2, 2 ) = x( n+j2 ) - ddot( j1-1, t( 1, j2 ), 1,
711 d( 1, 1 ) = d( 1, 1 ) - b( j1 )*x( n+1 )
712 d( 2, 1 ) = d( 2, 1 ) - b( j2 )*x( n+1 )
713 d( 1, 2 ) = d( 1, 2 ) + b( j1 )*x( 1 )
714 d( 2, 2 ) = d( 2, 2 ) + b( j2 )*x( 1 )
716 CALL dlaln2( .true., 2, 2, sminw, one, t( j1, j1 ),
717 $ ldt, one, one, d, 2, zero, w, v, 2,
718 $ scaloc, xnorm, ierr )
722 IF( scaloc.NE.one )
THEN
723 CALL dscal( n2, scaloc, x, 1 )
728 x( n+j1 ) = v( 1, 2 )
729 x( n+j2 ) = v( 2, 2 )
730 xmax = max( abs( x( j1 ) )+abs( x( n+j1 ) ),
731 $ abs( x( j2 ) )+abs( x( n+j2 ) ), xmax )
subroutine daxpy(n, da, dx, incx, dy, incy)
DAXPY
subroutine dladiv(a, b, c, d, p, q)
DLADIV performs complex division in real arithmetic, avoiding unnecessary overflow.
subroutine dlaln2(ltrans, na, nw, smin, ca, a, lda, d1, d2, b, ldb, wr, wi, x, ldx, scale, xnorm, info)
DLALN2 solves a 1-by-1 or 2-by-2 linear system of equations of the specified form.
subroutine dlaqtr(ltran, lreal, n, t, ldt, b, w, scale, x, work, info)
DLAQTR solves a real quasi-triangular system of equations, or a complex quasi-triangular system of sp...
subroutine dscal(n, da, dx, incx)
DSCAL