dgbsvx.f.html

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

HTML
538
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
 <head>
  <title>dgbsvx.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="DGBSVX.1"></a><a href="dgbsvx.f.html#DGBSVX.1">DGBSVX</a>( FACT, TRANS, N, KL, KU, NRHS, AB, LDAB, AFB,
     $                   LDAFB, IPIV, EQUED, R, C, B, LDB, X, LDX,
     $                   RCOND, FERR, BERR, WORK, IWORK, 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, KL, KU, LDAB, LDAFB, 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( * ), IWORK( * )
      DOUBLE PRECISION   AB( LDAB, * ), AFB( LDAFB, * ), B( LDB, * ),
     $                   BERR( * ), C( * ), FERR( * ), R( * ),
     $                   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="DGBSVX.24"></a><a href="dgbsvx.f.html#DGBSVX.1">DGBSVX</a> uses the LU factorization to compute the solution to a real
</span><span class="comment">*</span><span class="comment">  system of linear equations A * X = B, A**T * X = B, or A**H * X = B,
</span><span class="comment">*</span><span class="comment">  where A is a band matrix of order N with KL subdiagonals and KU
</span><span class="comment">*</span><span class="comment">  superdiagonals, 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 by this subroutine:
</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 = L * U,
</span><span class="comment">*</span><span class="comment">     where L is a product of permutation and unit lower triangular
</span><span class="comment">*</span><span class="comment">     matrices with KL subdiagonals, and U is upper triangular with
</span><span class="comment">*</span><span class="comment">     KL+KU superdiagonals.
</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, AFB and IPIV contain the factored form of
</span><span class="comment">*</span><span class="comment">                  A.  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">                  AB, AFB, and IPIV are not modified.
</span><span class="comment">*</span><span class="comment">          = 'N':  The matrix A will be copied to AFB 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 AFB 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  (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">  KL      (input) INTEGER
</span><span class="comment">*</span><span class="comment">          The number of subdiagonals within the band of A.  KL &gt;= 0.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  KU      (input) INTEGER
</span><span class="comment">*</span><span class="comment">          The number of superdiagonals within the band of A.  KU &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">  AB      (input/output) DOUBLE PRECISION array, dimension (LDAB,N)
</span><span class="comment">*</span><span class="comment">          On entry, the matrix A in band storage, in rows 1 to KL+KU+1.
</span><span class="comment">*</span><span class="comment">          The j-th column of A is stored in the j-th column of the
</span><span class="comment">*</span><span class="comment">          array AB as follows:
</span><span class="comment">*</span><span class="comment">          AB(KU+1+i-j,j) = A(i,j) for max(1,j-KU)&lt;=i&lt;=min(N,j+kl)
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">          If FACT = 'F' and EQUED is not 'N', then A must have been
</span><span class="comment">*</span><span class="comment">          equilibrated by the scaling factors in R and/or C.  AB is not
</span><span class="comment">*</span><span class="comment">          modified if FACT = 'F' or 'N', or if FACT = 'E' and
</span><span class="comment">*</span><span class="comment">          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">  LDAB    (input) INTEGER
</span><span class="comment">*</span><span class="comment">          The leading dimension of the array AB.  LDAB &gt;= KL+KU+1.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  AFB     (input or output) DOUBLE PRECISION array, dimension (LDAFB,N)
</span><span class="comment">*</span><span class="comment">          If FACT = 'F', then AFB is an input argument and on entry
</span><span class="comment">*</span><span class="comment">          contains details of the LU factorization of the band matrix
</span><span class="comment">*</span><span class="comment">          A, as computed by <a name="DGBTRF.129"></a><a href="dgbtrf.f.html#DGBTRF.1">DGBTRF</a>.  U is stored as an upper triangular
</span><span class="comment">*</span><span class="comment">          band matrix with KL+KU superdiagonals in rows 1 to KL+KU+1,
</span><span class="comment">*</span><span class="comment">          and the multipliers used during the factorization are stored
</span><span class="comment">*</span><span class="comment">          in rows KL+KU+2 to 2*KL+KU+1.  If EQUED .ne. 'N', then AFB is
</span><span class="comment">*</span><span class="comment">          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 AFB is an output argument and on exit
</span><span class="comment">*</span><span class="comment">          returns details of the LU factorization of A.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">          If FACT = 'E', then AFB is an output argument and on exit
</span><span class="comment">*</span><span class="comment">          returns details of the LU factorization of the equilibrated
</span><span class="comment">*</span><span class="comment">          matrix A (see the description of AB for the form of the
</span><span class="comment">*</span><span class="comment">          equilibrated matrix).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  LDAFB   (input) INTEGER
</span><span class="comment">*</span><span class="comment">          The leading dimension of the array AFB.  LDAFB &gt;= 2*KL+KU+1.
</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 = L*U
</span><span class="comment">*</span><span class="comment">          as computed by <a name="DGBTRF.149"></a><a href="dgbtrf.f.html#DGBTRF.1">DGBTRF</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 = 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 = 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.

⌨️ 快捷键说明

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