zggsvp.f.html
来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 427 行 · 第 1/3 页
HTML
427 行
</span> CALL <a name="ZGERQ2.268"></a><a href="zgerq2.f.html#ZGERQ2.1">ZGERQ2</a>( L, N, B, LDB, TAU, WORK, INFO )
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Update A := A*Z'
</span><span class="comment">*</span><span class="comment">
</span> CALL <a name="ZUNMR2.272"></a><a href="zunmr2.f.html#ZUNMR2.1">ZUNMR2</a>( <span class="string">'Right'</span>, <span class="string">'Conjugate transpose'</span>, M, N, L, B, LDB,
$ TAU, A, LDA, WORK, INFO )
IF( WANTQ ) THEN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Update Q := Q*Z'
</span><span class="comment">*</span><span class="comment">
</span> CALL <a name="ZUNMR2.278"></a><a href="zunmr2.f.html#ZUNMR2.1">ZUNMR2</a>( <span class="string">'Right'</span>, <span class="string">'Conjugate transpose'</span>, N, N, L, B,
$ LDB, TAU, Q, LDQ, WORK, INFO )
END IF
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Clean up B
</span><span class="comment">*</span><span class="comment">
</span> CALL <a name="ZLASET.284"></a><a href="zlaset.f.html#ZLASET.1">ZLASET</a>( <span class="string">'Full'</span>, L, N-L, CZERO, CZERO, B, LDB )
DO 60 J = N - L + 1, N
DO 50 I = J - N + L + 1, L
B( I, J ) = CZERO
50 CONTINUE
60 CONTINUE
<span class="comment">*</span><span class="comment">
</span> END IF
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Let N-L L
</span><span class="comment">*</span><span class="comment"> A = ( A11 A12 ) M,
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> then the following does the complete QR decomposition of A11:
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> A11 = U*( 0 T12 )*P1'
</span><span class="comment">*</span><span class="comment"> ( 0 0 )
</span><span class="comment">*</span><span class="comment">
</span> DO 70 I = 1, N - L
IWORK( I ) = 0
70 CONTINUE
CALL <a name="ZGEQPF.304"></a><a href="zgeqpf.f.html#ZGEQPF.1">ZGEQPF</a>( M, N-L, A, LDA, IWORK, TAU, WORK, RWORK, INFO )
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Determine the effective rank of A11
</span><span class="comment">*</span><span class="comment">
</span> K = 0
DO 80 I = 1, MIN( M, N-L )
IF( CABS1( A( I, I ) ).GT.TOLA )
$ K = K + 1
80 CONTINUE
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Update A12 := U'*A12, where A12 = A( 1:M, N-L+1:N )
</span><span class="comment">*</span><span class="comment">
</span> CALL <a name="ZUNM2R.316"></a><a href="zunm2r.f.html#ZUNM2R.1">ZUNM2R</a>( <span class="string">'Left'</span>, <span class="string">'Conjugate transpose'</span>, M, L, MIN( M, N-L ),
$ A, LDA, TAU, A( 1, N-L+1 ), LDA, WORK, INFO )
<span class="comment">*</span><span class="comment">
</span> IF( WANTU ) THEN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Copy the details of U, and form U
</span><span class="comment">*</span><span class="comment">
</span> CALL <a name="ZLASET.323"></a><a href="zlaset.f.html#ZLASET.1">ZLASET</a>( <span class="string">'Full'</span>, M, M, CZERO, CZERO, U, LDU )
IF( M.GT.1 )
$ CALL <a name="ZLACPY.325"></a><a href="zlacpy.f.html#ZLACPY.1">ZLACPY</a>( <span class="string">'Lower'</span>, M-1, N-L, A( 2, 1 ), LDA, U( 2, 1 ),
$ LDU )
CALL <a name="ZUNG2R.327"></a><a href="zung2r.f.html#ZUNG2R.1">ZUNG2R</a>( M, M, MIN( M, N-L ), U, LDU, TAU, WORK, INFO )
END IF
<span class="comment">*</span><span class="comment">
</span> IF( WANTQ ) THEN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Update Q( 1:N, 1:N-L ) = Q( 1:N, 1:N-L )*P1
</span><span class="comment">*</span><span class="comment">
</span> CALL <a name="ZLAPMT.334"></a><a href="zlapmt.f.html#ZLAPMT.1">ZLAPMT</a>( FORWRD, N, N-L, Q, LDQ, IWORK )
END IF
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Clean up A: set the strictly lower triangular part of
</span><span class="comment">*</span><span class="comment"> A(1:K, 1:K) = 0, and A( K+1:M, 1:N-L ) = 0.
</span><span class="comment">*</span><span class="comment">
</span> DO 100 J = 1, K - 1
DO 90 I = J + 1, K
A( I, J ) = CZERO
90 CONTINUE
100 CONTINUE
IF( M.GT.K )
$ CALL <a name="ZLASET.346"></a><a href="zlaset.f.html#ZLASET.1">ZLASET</a>( <span class="string">'Full'</span>, M-K, N-L, CZERO, CZERO, A( K+1, 1 ), LDA )
<span class="comment">*</span><span class="comment">
</span> IF( N-L.GT.K ) THEN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> RQ factorization of ( T11 T12 ) = ( 0 T12 )*Z1
</span><span class="comment">*</span><span class="comment">
</span> CALL <a name="ZGERQ2.352"></a><a href="zgerq2.f.html#ZGERQ2.1">ZGERQ2</a>( K, N-L, A, LDA, TAU, WORK, INFO )
<span class="comment">*</span><span class="comment">
</span> IF( WANTQ ) THEN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Update Q( 1:N,1:N-L ) = Q( 1:N,1:N-L )*Z1'
</span><span class="comment">*</span><span class="comment">
</span> CALL <a name="ZUNMR2.358"></a><a href="zunmr2.f.html#ZUNMR2.1">ZUNMR2</a>( <span class="string">'Right'</span>, <span class="string">'Conjugate transpose'</span>, N, N-L, K, A,
$ LDA, TAU, Q, LDQ, WORK, INFO )
END IF
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Clean up A
</span><span class="comment">*</span><span class="comment">
</span> CALL <a name="ZLASET.364"></a><a href="zlaset.f.html#ZLASET.1">ZLASET</a>( <span class="string">'Full'</span>, K, N-L-K, CZERO, CZERO, A, LDA )
DO 120 J = N - L - K + 1, N - L
DO 110 I = J - N + L + K + 1, K
A( I, J ) = CZERO
110 CONTINUE
120 CONTINUE
<span class="comment">*</span><span class="comment">
</span> END IF
<span class="comment">*</span><span class="comment">
</span> IF( M.GT.K ) THEN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> QR factorization of A( K+1:M,N-L+1:N )
</span><span class="comment">*</span><span class="comment">
</span> CALL <a name="ZGEQR2.377"></a><a href="zgeqr2.f.html#ZGEQR2.1">ZGEQR2</a>( M-K, L, A( K+1, N-L+1 ), LDA, TAU, WORK, INFO )
<span class="comment">*</span><span class="comment">
</span> IF( WANTU ) THEN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Update U(:,K+1:M) := U(:,K+1:M)*U1
</span><span class="comment">*</span><span class="comment">
</span> CALL <a name="ZUNM2R.383"></a><a href="zunm2r.f.html#ZUNM2R.1">ZUNM2R</a>( <span class="string">'Right'</span>, <span class="string">'No transpose'</span>, M, M-K, MIN( M-K, L ),
$ A( K+1, N-L+1 ), LDA, TAU, U( 1, K+1 ), LDU,
$ WORK, INFO )
END IF
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Clean up
</span><span class="comment">*</span><span class="comment">
</span> DO 140 J = N - L + 1, N
DO 130 I = J - N + K + L + 1, M
A( I, J ) = CZERO
130 CONTINUE
140 CONTINUE
<span class="comment">*</span><span class="comment">
</span> END IF
<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="ZGGSVP.400"></a><a href="zggsvp.f.html#ZGGSVP.1">ZGGSVP</a>
</span><span class="comment">*</span><span class="comment">
</span> END
</pre>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?