cgelsy.f.html

来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 410 行 · 第 1/3 页

HTML
410
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
 <head>
  <title>cgelsy.f</title>
 <meta name="generator" content="emacs 21.3.1; htmlfontify 0.20">
<style type="text/css"><!-- 
body { background: rgb(255, 255, 255);  color: rgb(0, 0, 0);  font-style: normal;  font-weight: 500;  font-stretch: normal;  font-family: adobe-courier;  font-size: 11pt;  text-decoration: none; }
span.default   { background: rgb(255, 255, 255);  color: rgb(0, 0, 0);  font-style: normal;  font-weight: 500;  font-stretch: normal;  font-family: adobe-courier;  font-size: 11pt;  text-decoration: none; }
span.default a { background: rgb(255, 255, 255);  color: rgb(0, 0, 0);  font-style: normal;  font-weight: 500;  font-stretch: normal;  font-family: adobe-courier;  font-size: 11pt;  text-decoration: underline; }
span.string   { color: rgb(188, 143, 143);  background: rgb(255, 255, 255);  font-style: normal;  font-weight: 500;  font-stretch: normal;  font-family: adobe-courier;  font-size: 11pt;  text-decoration: none; }
span.string a { color: rgb(188, 143, 143);  background: rgb(255, 255, 255);  font-style: normal;  font-weight: 500;  font-stretch: normal;  font-family: adobe-courier;  font-size: 11pt;  text-decoration: underline; }
span.comment   { color: rgb(178, 34, 34);  background: rgb(255, 255, 255);  font-style: normal;  font-weight: 500;  font-stretch: normal;  font-family: adobe-courier;  font-size: 11pt;  text-decoration: none; }
span.comment a { color: rgb(178, 34, 34);  background: rgb(255, 255, 255);  font-style: normal;  font-weight: 500;  font-stretch: normal;  font-family: adobe-courier;  font-size: 11pt;  text-decoration: underline; }
 --></style>

 </head>
  <body>

<pre>
      SUBROUTINE <a name="CGELSY.1"></a><a href="cgelsy.f.html#CGELSY.1">CGELSY</a>( M, N, NRHS, A, LDA, B, LDB, JPVT, RCOND, RANK,
     $                   WORK, LWORK, RWORK, INFO )
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  -- LAPACK driver routine (version 3.1) --
</span><span class="comment">*</span><span class="comment">     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
</span><span class="comment">*</span><span class="comment">     November 2006
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     .. Scalar Arguments ..
</span>      INTEGER            INFO, LDA, LDB, LWORK, M, N, NRHS, RANK
      REAL               RCOND
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Array Arguments ..
</span>      INTEGER            JPVT( * )
      REAL               RWORK( * )
      COMPLEX            A( LDA, * ), B( LDB, * ), WORK( * )
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  Purpose
</span><span class="comment">*</span><span class="comment">  =======
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  <a name="CGELSY.21"></a><a href="cgelsy.f.html#CGELSY.1">CGELSY</a> computes the minimum-norm solution to a complex linear least
</span><span class="comment">*</span><span class="comment">  squares problem:
</span><span class="comment">*</span><span class="comment">      minimize || A * X - B ||
</span><span class="comment">*</span><span class="comment">  using a complete orthogonal factorization of A.  A is an M-by-N
</span><span class="comment">*</span><span class="comment">  matrix which may be rank-deficient.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  Several right hand side vectors b and solution vectors x can be
</span><span class="comment">*</span><span class="comment">  handled in a single call; they are stored as the columns of the
</span><span class="comment">*</span><span class="comment">  M-by-NRHS right hand side matrix B and the N-by-NRHS solution
</span><span class="comment">*</span><span class="comment">  matrix X.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  The routine first computes a QR factorization with column pivoting:
</span><span class="comment">*</span><span class="comment">      A * P = Q * [ R11 R12 ]
</span><span class="comment">*</span><span class="comment">                  [  0  R22 ]
</span><span class="comment">*</span><span class="comment">  with R11 defined as the largest leading submatrix whose estimated
</span><span class="comment">*</span><span class="comment">  condition number is less than 1/RCOND.  The order of R11, RANK,
</span><span class="comment">*</span><span class="comment">  is the effective rank of A.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  Then, R22 is considered to be negligible, and R12 is annihilated
</span><span class="comment">*</span><span class="comment">  by unitary transformations from the right, arriving at the
</span><span class="comment">*</span><span class="comment">  complete orthogonal factorization:
</span><span class="comment">*</span><span class="comment">     A * P = Q * [ T11 0 ] * Z
</span><span class="comment">*</span><span class="comment">                 [  0  0 ]
</span><span class="comment">*</span><span class="comment">  The minimum-norm solution is then
</span><span class="comment">*</span><span class="comment">     X = P * Z' [ inv(T11)*Q1'*B ]
</span><span class="comment">*</span><span class="comment">                [        0       ]
</span><span class="comment">*</span><span class="comment">  where Q1 consists of the first RANK columns of Q.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  This routine is basically identical to the original xGELSX except
</span><span class="comment">*</span><span class="comment">  three differences:
</span><span class="comment">*</span><span class="comment">    o The permutation of matrix B (the right hand side) is faster and
</span><span class="comment">*</span><span class="comment">      more simple.
</span><span class="comment">*</span><span class="comment">    o The call to the subroutine xGEQPF has been substituted by the
</span><span class="comment">*</span><span class="comment">      the call to the subroutine xGEQP3. This subroutine is a Blas-3
</span><span class="comment">*</span><span class="comment">      version of the QR factorization with column pivoting.
</span><span class="comment">*</span><span class="comment">    o Matrix B (the right hand side) is updated with Blas-3.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  Arguments
</span><span class="comment">*</span><span class="comment">  =========
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  M       (input) INTEGER
</span><span class="comment">*</span><span class="comment">          The number of rows of the matrix A.  M &gt;= 0.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  N       (input) INTEGER
</span><span class="comment">*</span><span class="comment">          The number of columns of the matrix A.  N &gt;= 0.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  NRHS    (input) INTEGER
</span><span class="comment">*</span><span class="comment">          The number of right hand sides, i.e., the number of
</span><span class="comment">*</span><span class="comment">          columns of matrices B and X. NRHS &gt;= 0.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  A       (input/output) COMPLEX array, dimension (LDA,N)
</span><span class="comment">*</span><span class="comment">          On entry, the M-by-N matrix A.
</span><span class="comment">*</span><span class="comment">          On exit, A has been overwritten by details of its
</span><span class="comment">*</span><span class="comment">          complete orthogonal factorization.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  LDA     (input) INTEGER
</span><span class="comment">*</span><span class="comment">          The leading dimension of the array A.  LDA &gt;= max(1,M).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  B       (input/output) COMPLEX array, dimension (LDB,NRHS)
</span><span class="comment">*</span><span class="comment">          On entry, the M-by-NRHS right hand side matrix B.
</span><span class="comment">*</span><span class="comment">          On exit, the N-by-NRHS solution matrix X.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  LDB     (input) INTEGER
</span><span class="comment">*</span><span class="comment">          The leading dimension of the array B. LDB &gt;= max(1,M,N).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  JPVT    (input/output) INTEGER array, dimension (N)
</span><span class="comment">*</span><span class="comment">          On entry, if JPVT(i) .ne. 0, the i-th column of A is permuted
</span><span class="comment">*</span><span class="comment">          to the front of AP, otherwise column i is a free column.
</span><span class="comment">*</span><span class="comment">          On exit, if JPVT(i) = k, then the i-th column of A*P
</span><span class="comment">*</span><span class="comment">          was the k-th column of A.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  RCOND   (input) REAL
</span><span class="comment">*</span><span class="comment">          RCOND is used to determine the effective rank of A, which
</span><span class="comment">*</span><span class="comment">          is defined as the order of the largest leading triangular
</span><span class="comment">*</span><span class="comment">          submatrix R11 in the QR factorization with pivoting of A,
</span><span class="comment">*</span><span class="comment">          whose estimated condition number &lt; 1/RCOND.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  RANK    (output) INTEGER
</span><span class="comment">*</span><span class="comment">          The effective rank of A, i.e., the order of the submatrix
</span><span class="comment">*</span><span class="comment">          R11.  This is the same as the order of the submatrix T11
</span><span class="comment">*</span><span class="comment">          in the complete orthogonal factorization of A.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  WORK    (workspace/output) COMPLEX 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 dimension of the array WORK.
</span><span class="comment">*</span><span class="comment">          The unblocked strategy requires that:
</span><span class="comment">*</span><span class="comment">            LWORK &gt;= MN + MAX( 2*MN, N+1, MN+NRHS )
</span><span class="comment">*</span><span class="comment">          where MN = min(M,N).
</span><span class="comment">*</span><span class="comment">          The block algorithm requires that:
</span><span class="comment">*</span><span class="comment">            LWORK &gt;= MN + MAX( 2*MN, NB*(N+1), MN+MN*NB, MN+NB*NRHS )
</span><span class="comment">*</span><span class="comment">          where NB is an upper bound on the blocksize returned
</span><span class="comment">*</span><span class="comment">          by <a name="ILAENV.114"></a><a href="hfy-index.html#ILAENV">ILAENV</a> for the routines <a name="CGEQP3.114"></a><a href="cgeqp3.f.html#CGEQP3.1">CGEQP3</a>, <a name="CTZRZF.114"></a><a href="ctzrzf.f.html#CTZRZF.1">CTZRZF</a>, <a name="CTZRQF.114"></a><a href="ctzrqf.f.html#CTZRQF.1">CTZRQF</a>, <a name="CUNMQR.114"></a><a href="cunmqr.f.html#CUNMQR.1">CUNMQR</a>,
</span><span class="comment">*</span><span class="comment">          and <a name="CUNMRZ.115"></a><a href="cunmrz.f.html#CUNMRZ.1">CUNMRZ</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

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?