📄 dlaqtr.f.html
字号:
</span> IF( XJ.EQ.ZERO )
$ GO TO 30
<span class="comment">*</span><span class="comment">
</span> IF( TJJ.LT.ONE ) THEN
IF( XJ.GT.BIGNUM*TJJ ) THEN
REC = ONE / XJ
CALL DSCAL( N, REC, X, 1 )
SCALE = SCALE*REC
XMAX = XMAX*REC
END IF
END IF
X( J1 ) = X( J1 ) / TMP
XJ = ABS( X( J1 ) )
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Scale x if necessary to avoid overflow when adding a
</span><span class="comment">*</span><span class="comment"> multiple of column j1 of T.
</span><span class="comment">*</span><span class="comment">
</span> IF( XJ.GT.ONE ) THEN
REC = ONE / XJ
IF( WORK( J1 ).GT.( BIGNUM-XMAX )*REC ) THEN
CALL DSCAL( N, REC, X, 1 )
SCALE = SCALE*REC
END IF
END IF
IF( J1.GT.1 ) THEN
CALL DAXPY( J1-1, -X( J1 ), T( 1, J1 ), 1, X, 1 )
K = IDAMAX( J1-1, X, 1 )
XMAX = ABS( X( K ) )
END IF
<span class="comment">*</span><span class="comment">
</span> ELSE
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Meet 2 by 2 diagonal block
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Call 2 by 2 linear system solve, to take
</span><span class="comment">*</span><span class="comment"> care of possible overflow by scaling factor.
</span><span class="comment">*</span><span class="comment">
</span> D( 1, 1 ) = X( J1 )
D( 2, 1 ) = X( J2 )
CALL <a name="DLALN2.251"></a><a href="dlaln2.f.html#DLALN2.1">DLALN2</a>( .FALSE., 2, 1, SMIN, ONE, T( J1, J1 ),
$ LDT, ONE, ONE, D, 2, ZERO, ZERO, V, 2,
$ SCALOC, XNORM, IERR )
IF( IERR.NE.0 )
$ INFO = 2
<span class="comment">*</span><span class="comment">
</span> IF( SCALOC.NE.ONE ) THEN
CALL DSCAL( N, SCALOC, X, 1 )
SCALE = SCALE*SCALOC
END IF
X( J1 ) = V( 1, 1 )
X( J2 ) = V( 2, 1 )
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Scale V(1,1) (= X(J1)) and/or V(2,1) (=X(J2))
</span><span class="comment">*</span><span class="comment"> to avoid overflow in updating right-hand side.
</span><span class="comment">*</span><span class="comment">
</span> XJ = MAX( ABS( V( 1, 1 ) ), ABS( V( 2, 1 ) ) )
IF( XJ.GT.ONE ) THEN
REC = ONE / XJ
IF( MAX( WORK( J1 ), WORK( J2 ) ).GT.
$ ( BIGNUM-XMAX )*REC ) THEN
CALL DSCAL( N, REC, X, 1 )
SCALE = SCALE*REC
END IF
END IF
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Update right-hand side
</span><span class="comment">*</span><span class="comment">
</span> IF( J1.GT.1 ) THEN
CALL DAXPY( J1-1, -X( J1 ), T( 1, J1 ), 1, X, 1 )
CALL DAXPY( J1-1, -X( J2 ), T( 1, J2 ), 1, X, 1 )
K = IDAMAX( J1-1, X, 1 )
XMAX = ABS( X( K ) )
END IF
<span class="comment">*</span><span class="comment">
</span> END IF
<span class="comment">*</span><span class="comment">
</span> 30 CONTINUE
<span class="comment">*</span><span class="comment">
</span> ELSE
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Solve T'*p = scale*c
</span><span class="comment">*</span><span class="comment">
</span> JNEXT = 1
DO 40 J = 1, N
IF( J.LT.JNEXT )
$ GO TO 40
J1 = J
J2 = J
JNEXT = J + 1
IF( J.LT.N ) THEN
IF( T( J+1, J ).NE.ZERO ) THEN
J2 = J + 1
JNEXT = J + 2
END IF
END IF
<span class="comment">*</span><span class="comment">
</span> IF( J1.EQ.J2 ) THEN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> 1 by 1 diagonal block
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Scale if necessary to avoid overflow in forming the
</span><span class="comment">*</span><span class="comment"> right-hand side element by inner product.
</span><span class="comment">*</span><span class="comment">
</span> XJ = ABS( X( J1 ) )
IF( XMAX.GT.ONE ) THEN
REC = ONE / XMAX
IF( WORK( J1 ).GT.( BIGNUM-XJ )*REC ) THEN
CALL DSCAL( N, REC, X, 1 )
SCALE = SCALE*REC
XMAX = XMAX*REC
END IF
END IF
<span class="comment">*</span><span class="comment">
</span> X( J1 ) = X( J1 ) - DDOT( J1-1, T( 1, J1 ), 1, X, 1 )
<span class="comment">*</span><span class="comment">
</span> XJ = ABS( X( J1 ) )
TJJ = ABS( T( J1, J1 ) )
TMP = T( J1, J1 )
IF( TJJ.LT.SMIN ) THEN
TMP = SMIN
TJJ = SMIN
INFO = 1
END IF
<span class="comment">*</span><span class="comment">
</span> IF( TJJ.LT.ONE ) THEN
IF( XJ.GT.BIGNUM*TJJ ) THEN
REC = ONE / XJ
CALL DSCAL( N, REC, X, 1 )
SCALE = SCALE*REC
XMAX = XMAX*REC
END IF
END IF
X( J1 ) = X( J1 ) / TMP
XMAX = MAX( XMAX, ABS( X( J1 ) ) )
<span class="comment">*</span><span class="comment">
</span> ELSE
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> 2 by 2 diagonal block
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Scale if necessary to avoid overflow in forming the
</span><span class="comment">*</span><span class="comment"> right-hand side elements by inner product.
</span><span class="comment">*</span><span class="comment">
</span> XJ = MAX( ABS( X( J1 ) ), ABS( X( J2 ) ) )
IF( XMAX.GT.ONE ) THEN
REC = ONE / XMAX
IF( MAX( WORK( J2 ), WORK( J1 ) ).GT.( BIGNUM-XJ )*
$ REC ) THEN
CALL DSCAL( N, REC, X, 1 )
SCALE = SCALE*REC
XMAX = XMAX*REC
END IF
END IF
<span class="comment">*</span><span class="comment">
</span> D( 1, 1 ) = X( J1 ) - DDOT( J1-1, T( 1, J1 ), 1, X,
$ 1 )
D( 2, 1 ) = X( J2 ) - DDOT( J1-1, T( 1, J2 ), 1, X,
$ 1 )
<span class="comment">*</span><span class="comment">
</span> CALL <a name="DLALN2.370"></a><a href="dlaln2.f.html#DLALN2.1">DLALN2</a>( .TRUE., 2, 1, SMIN, ONE, T( J1, J1 ),
$ LDT, ONE, ONE, D, 2, ZERO, ZERO, V, 2,
$ SCALOC, XNORM, IERR )
IF( IERR.NE.0 )
$ INFO = 2
<span class="comment">*</span><span class="comment">
</span> IF( SCALOC.NE.ONE ) THEN
CALL DSCAL( N, SCALOC, X, 1 )
SCALE = SCALE*SCALOC
END IF
X( J1 ) = V( 1, 1 )
X( J2 ) = V( 2, 1 )
XMAX = MAX( ABS( X( J1 ) ), ABS( X( J2 ) ), XMAX )
<span class="comment">*</span><span class="comment">
</span> END IF
40 CONTINUE
END IF
<span class="comment">*</span><span class="comment">
</span> ELSE
<span class="comment">*</span><span class="comment">
</span> SMINW = MAX( EPS*ABS( W ), SMIN )
IF( NOTRAN ) THEN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Solve (T + iB)*(p+iq) = c+id
</span><span class="comment">*</span><span class="comment">
</span> JNEXT = N
DO 70 J = N, 1, -1
IF( J.GT.JNEXT )
$ GO TO 70
J1 = J
J2 = J
JNEXT = J - 1
IF( J.GT.1 ) THEN
IF( T( J, J-1 ).NE.ZERO ) THEN
J1 = J - 1
JNEXT = J - 2
END IF
END IF
<span class="comment">*</span><span class="comment">
</span> IF( J1.EQ.J2 ) THEN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> 1 by 1 diagonal block
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Scale if necessary to avoid overflow in division
</span><span class="comment">*</span><span class="comment">
</span> Z = W
IF( J1.EQ.1 )
$ Z = B( 1 )
XJ = ABS( X( J1 ) ) + ABS( X( N+J1 ) )
TJJ = ABS( T( J1, J1 ) ) + ABS( Z )
TMP = T( J1, J1 )
IF( TJJ.LT.SMINW ) THEN
TMP = SMINW
TJJ = SMINW
INFO = 1
END IF
<span class="comment">*</span><span class="comment">
</span> IF( XJ.EQ.ZERO )
$ GO TO 70
<span class="comment">*</span><span class="comment">
</span> IF( TJJ.LT.ONE ) THEN
IF( XJ.GT.BIGNUM*TJJ ) THEN
REC = ONE / XJ
CALL DSCAL( N2, REC, X, 1 )
SCALE = SCALE*REC
XMAX = XMAX*REC
END IF
END IF
CALL <a name="DLADIV.438"></a><a href="dladiv.f.html#DLADIV.1">DLADIV</a>( X( J1 ), X( N+J1 ), TMP, Z, SR, SI )
X( J1 ) = SR
X( N+J1 ) = SI
XJ = ABS( X( J1 ) ) + ABS( X( N+J1 ) )
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -