dggrqf.f.html
来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 236 行 · 第 1/2 页
HTML
236 行
</span><span class="comment">*</span><span class="comment"> blocksize for a call of <a name="DORMRQ.100"></a><a href="dormrq.f.html#DORMRQ.1">DORMRQ</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.105"></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 INF0= -i, the i-th argument had an illegal value.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Further Details
</span><span class="comment">*</span><span class="comment"> ===============
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> The matrix Q is represented as a product of elementary reflectors
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Q = H(1) H(2) . . . H(k), where k = min(m,n).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Each H(i) has the form
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> H(i) = I - taua * v * v'
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> where taua is a real scalar, and v is a real vector with
</span><span class="comment">*</span><span class="comment"> v(n-k+i+1:n) = 0 and v(n-k+i) = 1; v(1:n-k+i-1) is stored on exit in
</span><span class="comment">*</span><span class="comment"> A(m-k+i,1:n-k+i-1), and taua in TAUA(i).
</span><span class="comment">*</span><span class="comment"> To form Q explicitly, use LAPACK subroutine <a name="DORGRQ.125"></a><a href="dorgrq.f.html#DORGRQ.1">DORGRQ</a>.
</span><span class="comment">*</span><span class="comment"> To use Q to update another matrix, use LAPACK subroutine <a name="DORMRQ.126"></a><a href="dormrq.f.html#DORMRQ.1">DORMRQ</a>.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> The matrix Z is represented as a product of elementary reflectors
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Z = H(1) H(2) . . . H(k), where k = min(p,n).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Each H(i) has the form
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> H(i) = I - taub * v * v'
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> where taub is a real scalar, and v is a real vector with
</span><span class="comment">*</span><span class="comment"> v(1:i-1) = 0 and v(i) = 1; v(i+1:p) is stored on exit in B(i+1:p,i),
</span><span class="comment">*</span><span class="comment"> and taub in TAUB(i).
</span><span class="comment">*</span><span class="comment"> To form Z explicitly, use LAPACK subroutine <a name="DORGQR.139"></a><a href="dorgqr.f.html#DORGQR.1">DORGQR</a>.
</span><span class="comment">*</span><span class="comment"> To use Z to update another matrix, use LAPACK subroutine <a name="DORMQR.140"></a><a href="dormqr.f.html#DORMQR.1">DORMQR</a>.
</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 LOPT, LWKOPT, NB, NB1, NB2, NB3
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. External Subroutines ..
</span> EXTERNAL <a name="DGEQRF.149"></a><a href="dgeqrf.f.html#DGEQRF.1">DGEQRF</a>, <a name="DGERQF.149"></a><a href="dgerqf.f.html#DGERQF.1">DGERQF</a>, <a name="DORMRQ.149"></a><a href="dormrq.f.html#DORMRQ.1">DORMRQ</a>, <a name="XERBLA.149"></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"> .. External Functions ..
</span> INTEGER <a name="ILAENV.152"></a><a href="hfy-index.html#ILAENV">ILAENV</a>
EXTERNAL <a name="ILAENV.153"></a><a href="hfy-index.html#ILAENV">ILAENV</a>
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Intrinsic Functions ..
</span> INTRINSIC INT, MAX, MIN
<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
NB1 = <a name="ILAENV.163"></a><a href="hfy-index.html#ILAENV">ILAENV</a>( 1, <span class="string">'<a name="DGERQF.163"></a><a href="dgerqf.f.html#DGERQF.1">DGERQF</a>'</span>, <span class="string">' '</span>, M, N, -1, -1 )
NB2 = <a name="ILAENV.164"></a><a href="hfy-index.html#ILAENV">ILAENV</a>( 1, <span class="string">'<a name="DGEQRF.164"></a><a href="dgeqrf.f.html#DGEQRF.1">DGEQRF</a>'</span>, <span class="string">' '</span>, P, N, -1, -1 )
NB3 = <a name="ILAENV.165"></a><a href="hfy-index.html#ILAENV">ILAENV</a>( 1, <span class="string">'<a name="DORMRQ.165"></a><a href="dormrq.f.html#DORMRQ.1">DORMRQ</a>'</span>, <span class="string">' '</span>, M, N, P, -1 )
NB = MAX( NB1, NB2, NB3 )
LWKOPT = MAX( N, M, P )*NB
WORK( 1 ) = LWKOPT
LQUERY = ( LWORK.EQ.-1 )
IF( M.LT.0 ) THEN
INFO = -1
ELSE IF( P.LT.0 ) THEN
INFO = -2
ELSE IF( N.LT.0 ) THEN
INFO = -3
ELSE IF( LDA.LT.MAX( 1, M ) ) THEN
INFO = -5
ELSE IF( LDB.LT.MAX( 1, P ) ) THEN
INFO = -8
ELSE IF( LWORK.LT.MAX( 1, M, P, N ) .AND. .NOT.LQUERY ) THEN
INFO = -11
END IF
IF( INFO.NE.0 ) THEN
CALL <a name="XERBLA.184"></a><a href="xerbla.f.html#XERBLA.1">XERBLA</a>( <span class="string">'<a name="DGGRQF.184"></a><a href="dggrqf.f.html#DGGRQF.1">DGGRQF</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"> RQ factorization of M-by-N matrix A: A = R*Q
</span><span class="comment">*</span><span class="comment">
</span> CALL <a name="DGERQF.192"></a><a href="dgerqf.f.html#DGERQF.1">DGERQF</a>( M, N, A, LDA, TAUA, WORK, LWORK, INFO )
LOPT = WORK( 1 )
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Update B := B*Q'
</span><span class="comment">*</span><span class="comment">
</span> CALL <a name="DORMRQ.197"></a><a href="dormrq.f.html#DORMRQ.1">DORMRQ</a>( <span class="string">'Right'</span>, <span class="string">'Transpose'</span>, P, N, MIN( M, N ),
$ A( MAX( 1, M-N+1 ), 1 ), LDA, TAUA, B, LDB, WORK,
$ LWORK, INFO )
LOPT = MAX( LOPT, INT( WORK( 1 ) ) )
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> QR factorization of P-by-N matrix B: B = Z*T
</span><span class="comment">*</span><span class="comment">
</span> CALL <a name="DGEQRF.204"></a><a href="dgeqrf.f.html#DGEQRF.1">DGEQRF</a>( P, N, B, LDB, TAUB, WORK, LWORK, INFO )
WORK( 1 ) = MAX( LOPT, INT( WORK( 1 ) ) )
<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="DGGRQF.209"></a><a href="dggrqf.f.html#DGGRQF.1">DGGRQF</a>
</span><span class="comment">*</span><span class="comment">
</span> END
</pre>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?