dgecon.f.html
来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 210 行 · 第 1/2 页
HTML
210 行
</span><span class="comment">*</span><span class="comment"> .. External Subroutines ..
</span> EXTERNAL <a name="DLACN2.88"></a><a href="dlacn2.f.html#DLACN2.1">DLACN2</a>, <a name="DLATRS.88"></a><a href="dlatrs.f.html#DLATRS.1">DLATRS</a>, <a name="DRSCL.88"></a><a href="drscl.f.html#DRSCL.1">DRSCL</a>, <a name="XERBLA.88"></a><a href="xerbla.f.html#XERBLA.1">XERBLA</a>
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Intrinsic Functions ..
</span> INTRINSIC ABS, MAX
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Executable Statements ..
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Test the input parameters.
</span><span class="comment">*</span><span class="comment">
</span> INFO = 0
ONENRM = NORM.EQ.<span class="string">'1'</span> .OR. <a name="LSAME.98"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( NORM, <span class="string">'O'</span> )
IF( .NOT.ONENRM .AND. .NOT.<a name="LSAME.99"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( NORM, <span class="string">'I'</span> ) ) THEN
INFO = -1
ELSE IF( N.LT.0 ) THEN
INFO = -2
ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
INFO = -4
ELSE IF( ANORM.LT.ZERO ) THEN
INFO = -5
END IF
IF( INFO.NE.0 ) THEN
CALL <a name="XERBLA.109"></a><a href="xerbla.f.html#XERBLA.1">XERBLA</a>( <span class="string">'<a name="DGECON.109"></a><a href="dgecon.f.html#DGECON.1">DGECON</a>'</span>, -INFO )
RETURN
END IF
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Quick return if possible
</span><span class="comment">*</span><span class="comment">
</span> RCOND = ZERO
IF( N.EQ.0 ) THEN
RCOND = ONE
RETURN
ELSE IF( ANORM.EQ.ZERO ) THEN
RETURN
END IF
<span class="comment">*</span><span class="comment">
</span> SMLNUM = <a name="DLAMCH.123"></a><a href="dlamch.f.html#DLAMCH.1">DLAMCH</a>( <span class="string">'Safe minimum'</span> )
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Estimate the norm of inv(A).
</span><span class="comment">*</span><span class="comment">
</span> AINVNM = ZERO
NORMIN = <span class="string">'N'</span>
IF( ONENRM ) THEN
KASE1 = 1
ELSE
KASE1 = 2
END IF
KASE = 0
10 CONTINUE
CALL <a name="DLACN2.136"></a><a href="dlacn2.f.html#DLACN2.1">DLACN2</a>( N, WORK( N+1 ), WORK, IWORK, AINVNM, KASE, ISAVE )
IF( KASE.NE.0 ) THEN
IF( KASE.EQ.KASE1 ) THEN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Multiply by inv(L).
</span><span class="comment">*</span><span class="comment">
</span> CALL <a name="DLATRS.142"></a><a href="dlatrs.f.html#DLATRS.1">DLATRS</a>( <span class="string">'Lower'</span>, <span class="string">'No transpose'</span>, <span class="string">'Unit'</span>, NORMIN, N, A,
$ LDA, WORK, SL, WORK( 2*N+1 ), INFO )
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Multiply by inv(U).
</span><span class="comment">*</span><span class="comment">
</span> CALL <a name="DLATRS.147"></a><a href="dlatrs.f.html#DLATRS.1">DLATRS</a>( <span class="string">'Upper'</span>, <span class="string">'No transpose'</span>, <span class="string">'Non-unit'</span>, NORMIN, N,
$ A, LDA, WORK, SU, WORK( 3*N+1 ), INFO )
ELSE
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Multiply by inv(U').
</span><span class="comment">*</span><span class="comment">
</span> CALL <a name="DLATRS.153"></a><a href="dlatrs.f.html#DLATRS.1">DLATRS</a>( <span class="string">'Upper'</span>, <span class="string">'Transpose'</span>, <span class="string">'Non-unit'</span>, NORMIN, N, A,
$ LDA, WORK, SU, WORK( 3*N+1 ), INFO )
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Multiply by inv(L').
</span><span class="comment">*</span><span class="comment">
</span> CALL <a name="DLATRS.158"></a><a href="dlatrs.f.html#DLATRS.1">DLATRS</a>( <span class="string">'Lower'</span>, <span class="string">'Transpose'</span>, <span class="string">'Unit'</span>, NORMIN, N, A,
$ LDA, WORK, SL, WORK( 2*N+1 ), INFO )
END IF
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Divide X by 1/(SL*SU) if doing so will not cause overflow.
</span><span class="comment">*</span><span class="comment">
</span> SCALE = SL*SU
NORMIN = <span class="string">'Y'</span>
IF( SCALE.NE.ONE ) THEN
IX = IDAMAX( N, WORK, 1 )
IF( SCALE.LT.ABS( WORK( IX ) )*SMLNUM .OR. SCALE.EQ.ZERO )
$ GO TO 20
CALL <a name="DRSCL.170"></a><a href="drscl.f.html#DRSCL.1">DRSCL</a>( N, SCALE, WORK, 1 )
END IF
GO TO 10
END IF
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Compute the estimate of the reciprocal condition number.
</span><span class="comment">*</span><span class="comment">
</span> IF( AINVNM.NE.ZERO )
$ RCOND = ( ONE / AINVNM ) / ANORM
<span class="comment">*</span><span class="comment">
</span> 20 CONTINUE
RETURN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> End of <a name="DGECON.183"></a><a href="dgecon.f.html#DGECON.1">DGECON</a>
</span><span class="comment">*</span><span class="comment">
</span> END
</pre>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?