zgesvx.f.html

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

HTML
506
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
 <head>
  <title>zgesvx.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="ZGESVX.1"></a><a href="zgesvx.f.html#ZGESVX.1">ZGESVX</a>( FACT, TRANS, N, NRHS, A, LDA, AF, LDAF, IPIV,
     $                   EQUED, R, C, B, LDB, X, LDX, RCOND, FERR, BERR,
     $                   WORK, 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>      CHARACTER          EQUED, FACT, TRANS
      INTEGER            INFO, LDA, LDAF, LDB, LDX, N, NRHS
      DOUBLE PRECISION   RCOND
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Array Arguments ..
</span>      INTEGER            IPIV( * )
      DOUBLE PRECISION   BERR( * ), C( * ), FERR( * ), R( * ),
     $                   RWORK( * )
      COMPLEX*16         A( LDA, * ), AF( LDAF, * ), B( LDB, * ),
     $                   WORK( * ), X( LDX, * )
<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="ZGESVX.25"></a><a href="zgesvx.f.html#ZGESVX.1">ZGESVX</a> uses the LU factorization to compute the solution to a complex
</span><span class="comment">*</span><span class="comment">  system of linear equations
</span><span class="comment">*</span><span class="comment">     A * X = B,
</span><span class="comment">*</span><span class="comment">  where A is an N-by-N matrix and X and B are N-by-NRHS matrices.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  Error bounds on the solution and a condition estimate are also
</span><span class="comment">*</span><span class="comment">  provided.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  Description
</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 following steps are performed:
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  1. If FACT = 'E', real scaling factors are computed to equilibrate
</span><span class="comment">*</span><span class="comment">     the system:
</span><span class="comment">*</span><span class="comment">        TRANS = 'N':  diag(R)*A*diag(C)     *inv(diag(C))*X = diag(R)*B
</span><span class="comment">*</span><span class="comment">        TRANS = 'T': (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
</span><span class="comment">*</span><span class="comment">        TRANS = 'C': (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
</span><span class="comment">*</span><span class="comment">     Whether or not the system will be equilibrated depends on the
</span><span class="comment">*</span><span class="comment">     scaling of the matrix A, but if equilibration is used, A is
</span><span class="comment">*</span><span class="comment">     overwritten by diag(R)*A*diag(C) and B by diag(R)*B (if TRANS='N')
</span><span class="comment">*</span><span class="comment">     or diag(C)*B (if TRANS = 'T' or 'C').
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  2. If FACT = 'N' or 'E', the LU decomposition is used to factor the
</span><span class="comment">*</span><span class="comment">     matrix A (after equilibration if FACT = 'E') as
</span><span class="comment">*</span><span class="comment">        A = P * L * U,
</span><span class="comment">*</span><span class="comment">     where P is a permutation matrix, L is a unit lower triangular
</span><span class="comment">*</span><span class="comment">     matrix, and U is upper triangular.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  3. If some U(i,i)=0, so that U is exactly singular, then the routine
</span><span class="comment">*</span><span class="comment">     returns with INFO = i. Otherwise, the factored form of A is used
</span><span class="comment">*</span><span class="comment">     to estimate the condition number of the matrix A.  If the
</span><span class="comment">*</span><span class="comment">     reciprocal of the condition number is less than machine precision,
</span><span class="comment">*</span><span class="comment">     INFO = N+1 is returned as a warning, but the routine still goes on
</span><span class="comment">*</span><span class="comment">     to solve for X and compute error bounds as described below.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  4. The system of equations is solved for X using the factored form
</span><span class="comment">*</span><span class="comment">     of A.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  5. Iterative refinement is applied to improve the computed solution
</span><span class="comment">*</span><span class="comment">     matrix and calculate error bounds and backward error estimates
</span><span class="comment">*</span><span class="comment">     for it.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  6. If equilibration was used, the matrix X is premultiplied by
</span><span class="comment">*</span><span class="comment">     diag(C) (if TRANS = 'N') or diag(R) (if TRANS = 'T' or 'C') so
</span><span class="comment">*</span><span class="comment">     that it solves the original system before equilibration.
</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">  FACT    (input) CHARACTER*1
</span><span class="comment">*</span><span class="comment">          Specifies whether or not the factored form of the matrix A is
</span><span class="comment">*</span><span class="comment">          supplied on entry, and if not, whether the matrix A should be
</span><span class="comment">*</span><span class="comment">          equilibrated before it is factored.
</span><span class="comment">*</span><span class="comment">          = 'F':  On entry, AF and IPIV contain the factored form of A.
</span><span class="comment">*</span><span class="comment">                  If EQUED is not 'N', the matrix A has been
</span><span class="comment">*</span><span class="comment">                  equilibrated with scaling factors given by R and C.
</span><span class="comment">*</span><span class="comment">                  A, AF, and IPIV are not modified.
</span><span class="comment">*</span><span class="comment">          = 'N':  The matrix A will be copied to AF and factored.
</span><span class="comment">*</span><span class="comment">          = 'E':  The matrix A will be equilibrated if necessary, then
</span><span class="comment">*</span><span class="comment">                  copied to AF and factored.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  TRANS   (input) CHARACTER*1
</span><span class="comment">*</span><span class="comment">          Specifies the form of the system of equations:
</span><span class="comment">*</span><span class="comment">          = 'N':  A * X = B     (No transpose)
</span><span class="comment">*</span><span class="comment">          = 'T':  A**T * X = B  (Transpose)
</span><span class="comment">*</span><span class="comment">          = 'C':  A**H * X = B  (Conjugate transpose)
</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 linear equations, i.e., the order of the
</span><span class="comment">*</span><span class="comment">          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 columns
</span><span class="comment">*</span><span class="comment">          of the 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*16 array, dimension (LDA,N)
</span><span class="comment">*</span><span class="comment">          On entry, the N-by-N matrix A.  If FACT = 'F' and EQUED is
</span><span class="comment">*</span><span class="comment">          not 'N', then A must have been equilibrated by the scaling
</span><span class="comment">*</span><span class="comment">          factors in R and/or C.  A is not modified if FACT = 'F' or
</span><span class="comment">*</span><span class="comment">          'N', or if FACT = 'E' and EQUED = 'N' on exit.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">          On exit, if EQUED .ne. 'N', A is scaled as follows:
</span><span class="comment">*</span><span class="comment">          EQUED = 'R':  A := diag(R) * A
</span><span class="comment">*</span><span class="comment">          EQUED = 'C':  A := A * diag(C)
</span><span class="comment">*</span><span class="comment">          EQUED = 'B':  A := diag(R) * A * diag(C).
</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,N).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  AF      (input or output) COMPLEX*16 array, dimension (LDAF,N)
</span><span class="comment">*</span><span class="comment">          If FACT = 'F', then AF is an input argument and on entry
</span><span class="comment">*</span><span class="comment">          contains the factors L and U from the factorization
</span><span class="comment">*</span><span class="comment">          A = P*L*U as computed by <a name="ZGETRF.118"></a><a href="zgetrf.f.html#ZGETRF.1">ZGETRF</a>.  If EQUED .ne. 'N', then
</span><span class="comment">*</span><span class="comment">          AF is the factored form of the equilibrated matrix A.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">          If FACT = 'N', then AF is an output argument and on exit
</span><span class="comment">*</span><span class="comment">          returns the factors L and U from the factorization A = P*L*U
</span><span class="comment">*</span><span class="comment">          of the original matrix A.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">          If FACT = 'E', then AF is an output argument and on exit
</span><span class="comment">*</span><span class="comment">          returns the factors L and U from the factorization A = P*L*U
</span><span class="comment">*</span><span class="comment">          of the equilibrated matrix A (see the description of A for
</span><span class="comment">*</span><span class="comment">          the form of the equilibrated matrix).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  LDAF    (input) INTEGER
</span><span class="comment">*</span><span class="comment">          The leading dimension of the array AF.  LDAF &gt;= max(1,N).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  IPIV    (input or output) INTEGER array, dimension (N)
</span><span class="comment">*</span><span class="comment">          If FACT = 'F', then IPIV is an input argument and on entry
</span><span class="comment">*</span><span class="comment">          contains the pivot indices from the factorization A = P*L*U
</span><span class="comment">*</span><span class="comment">          as computed by <a name="ZGETRF.136"></a><a href="zgetrf.f.html#ZGETRF.1">ZGETRF</a>; row i of the matrix was interchanged
</span><span class="comment">*</span><span class="comment">          with row IPIV(i).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">          If FACT = 'N', then IPIV is an output argument and on exit
</span><span class="comment">*</span><span class="comment">          contains the pivot indices from the factorization A = P*L*U
</span><span class="comment">*</span><span class="comment">          of the original matrix A.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">          If FACT = 'E', then IPIV is an output argument and on exit
</span><span class="comment">*</span><span class="comment">          contains the pivot indices from the factorization A = P*L*U
</span><span class="comment">*</span><span class="comment">          of the equilibrated matrix A.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  EQUED   (input or output) CHARACTER*1
</span><span class="comment">*</span><span class="comment">          Specifies the form of equilibration that was done.
</span><span class="comment">*</span><span class="comment">          = 'N':  No equilibration (always true if FACT = 'N').
</span><span class="comment">*</span><span class="comment">          = 'R':  Row equilibration, i.e., A has been premultiplied by

⌨️ 快捷键说明

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