zsysv.f.html
来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 199 行 · 第 1/2 页
HTML
199 行
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> WORK (workspace/output) COMPLEX*16 array, dimension (MAX(1,LWORK))
</span><span class="comment">*</span><span class="comment"> On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> LWORK (input) INTEGER
</span><span class="comment">*</span><span class="comment"> The length of WORK. LWORK >= 1, and for best performance
</span><span class="comment">*</span><span class="comment"> LWORK >= max(1,N*NB), where NB is the optimal blocksize for
</span><span class="comment">*</span><span class="comment"> <a name="ZSYTRF.89"></a><a href="zsytrf.f.html#ZSYTRF.1">ZSYTRF</a>.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> If LWORK = -1, then a workspace query is assumed; the routine
</span><span class="comment">*</span><span class="comment"> only calculates the optimal size of the WORK array, returns
</span><span class="comment">*</span><span class="comment"> this value as the first entry of the WORK array, and no error
</span><span class="comment">*</span><span class="comment"> message related to LWORK is issued by <a name="XERBLA.94"></a><a href="xerbla.f.html#XERBLA.1">XERBLA</a>.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> INFO (output) INTEGER
</span><span class="comment">*</span><span class="comment"> = 0: successful exit
</span><span class="comment">*</span><span class="comment"> < 0: if INFO = -i, the i-th argument had an illegal value
</span><span class="comment">*</span><span class="comment"> > 0: if INFO = i, D(i,i) is exactly zero. The factorization
</span><span class="comment">*</span><span class="comment"> has been completed, but the block diagonal matrix D is
</span><span class="comment">*</span><span class="comment"> exactly singular, so the solution could not be computed.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> =====================================================================
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> .. Local Scalars ..
</span> LOGICAL LQUERY
INTEGER LWKOPT, NB
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. External Functions ..
</span> LOGICAL <a name="LSAME.110"></a><a href="lsame.f.html#LSAME.1">LSAME</a>
INTEGER <a name="ILAENV.111"></a><a href="hfy-index.html#ILAENV">ILAENV</a>
EXTERNAL <a name="LSAME.112"></a><a href="lsame.f.html#LSAME.1">LSAME</a>, <a name="ILAENV.112"></a><a href="hfy-index.html#ILAENV">ILAENV</a>
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. External Subroutines ..
</span> EXTERNAL <a name="XERBLA.115"></a><a href="xerbla.f.html#XERBLA.1">XERBLA</a>, <a name="ZSYTRF.115"></a><a href="zsytrf.f.html#ZSYTRF.1">ZSYTRF</a>, <a name="ZSYTRS.115"></a><a href="zsytrs.f.html#ZSYTRS.1">ZSYTRS</a>
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Intrinsic Functions ..
</span> INTRINSIC 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
LQUERY = ( LWORK.EQ.-1 )
IF( .NOT.<a name="LSAME.126"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( UPLO, <span class="string">'U'</span> ) .AND. .NOT.<a name="LSAME.126"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( UPLO, <span class="string">'L'</span> ) ) THEN
INFO = -1
ELSE IF( N.LT.0 ) THEN
INFO = -2
ELSE IF( NRHS.LT.0 ) THEN
INFO = -3
ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
INFO = -5
ELSE IF( LDB.LT.MAX( 1, N ) ) THEN
INFO = -8
ELSE IF( LWORK.LT.1 .AND. .NOT.LQUERY ) THEN
INFO = -10
END IF
<span class="comment">*</span><span class="comment">
</span> IF( INFO.EQ.0 ) THEN
IF( N.EQ.0 ) THEN
LWKOPT = 1
ELSE
NB = <a name="ILAENV.144"></a><a href="hfy-index.html#ILAENV">ILAENV</a>( 1, <span class="string">'<a name="ZSYTRF.144"></a><a href="zsytrf.f.html#ZSYTRF.1">ZSYTRF</a>'</span>, UPLO, N, -1, -1, -1 )
LWKOPT = N*NB
END IF
WORK( 1 ) = LWKOPT
END IF
<span class="comment">*</span><span class="comment">
</span> IF( INFO.NE.0 ) THEN
CALL <a name="XERBLA.151"></a><a href="xerbla.f.html#XERBLA.1">XERBLA</a>( <span class="string">'<a name="ZSYSV.151"></a><a href="zsysv.f.html#ZSYSV.1">ZSYSV</a> '</span>, -INFO )
RETURN
ELSE IF( LQUERY ) THEN
RETURN
END IF
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Compute the factorization A = U*D*U' or A = L*D*L'.
</span><span class="comment">*</span><span class="comment">
</span> CALL <a name="ZSYTRF.159"></a><a href="zsytrf.f.html#ZSYTRF.1">ZSYTRF</a>( UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO )
IF( INFO.EQ.0 ) THEN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Solve the system A*X = B, overwriting B with X.
</span><span class="comment">*</span><span class="comment">
</span> CALL <a name="ZSYTRS.164"></a><a href="zsytrs.f.html#ZSYTRS.1">ZSYTRS</a>( UPLO, N, NRHS, A, LDA, IPIV, B, LDB, INFO )
<span class="comment">*</span><span class="comment">
</span> END IF
<span class="comment">*</span><span class="comment">
</span> WORK( 1 ) = LWKOPT
<span class="comment">*</span><span class="comment">
</span> RETURN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> End of <a name="ZSYSV.172"></a><a href="zsysv.f.html#ZSYSV.1">ZSYSV</a>
</span><span class="comment">*</span><span class="comment">
</span> END
</pre>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?