cpbsvx.f.html

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

HTML
446
字号
</span><span class="comment">*</span><span class="comment">          matrix A (see the description of A 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;= KD+1.
</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">          = 'Y':  Equilibration was done, i.e., A has been replaced by
</span><span class="comment">*</span><span class="comment">                  diag(S) * A * diag(S).
</span><span class="comment">*</span><span class="comment">          EQUED is an input argument if FACT = 'F'; otherwise, it is an
</span><span class="comment">*</span><span class="comment">          output argument.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  S       (input or output) REAL array, dimension (N)
</span><span class="comment">*</span><span class="comment">          The scale factors for A; not accessed if EQUED = 'N'.  S is
</span><span class="comment">*</span><span class="comment">          an input argument if FACT = 'F'; otherwise, S is an output
</span><span class="comment">*</span><span class="comment">          argument.  If FACT = 'F' and EQUED = 'Y', each element of S
</span><span class="comment">*</span><span class="comment">          must be positive.
</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 N-by-NRHS right hand side matrix B.
</span><span class="comment">*</span><span class="comment">          On exit, if EQUED = 'N', B is not modified; if EQUED = 'Y',
</span><span class="comment">*</span><span class="comment">          B is overwritten by diag(S) * B.
</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,N).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  X       (output) COMPLEX array, dimension (LDX,NRHS)
</span><span class="comment">*</span><span class="comment">          If INFO = 0 or INFO = N+1, the N-by-NRHS solution matrix X to
</span><span class="comment">*</span><span class="comment">          the original system of equations.  Note that if EQUED = 'Y',
</span><span class="comment">*</span><span class="comment">          A and B are modified on exit, and the solution to the
</span><span class="comment">*</span><span class="comment">          equilibrated system is inv(diag(S))*X.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  LDX     (input) INTEGER
</span><span class="comment">*</span><span class="comment">          The leading dimension of the array X.  LDX &gt;= max(1,N).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  RCOND   (output) REAL
</span><span class="comment">*</span><span class="comment">          The estimate of the reciprocal condition number of the matrix
</span><span class="comment">*</span><span class="comment">          A after equilibration (if done).  If RCOND is less than the
</span><span class="comment">*</span><span class="comment">          machine precision (in particular, if RCOND = 0), the matrix
</span><span class="comment">*</span><span class="comment">          is singular to working precision.  This condition is
</span><span class="comment">*</span><span class="comment">          indicated by a return code of INFO &gt; 0.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  FERR    (output) REAL array, dimension (NRHS)
</span><span class="comment">*</span><span class="comment">          The estimated forward error bound for each solution vector
</span><span class="comment">*</span><span class="comment">          X(j) (the j-th column of the solution matrix X).
</span><span class="comment">*</span><span class="comment">          If XTRUE is the true solution corresponding to X(j), FERR(j)
</span><span class="comment">*</span><span class="comment">          is an estimated upper bound for the magnitude of the largest
</span><span class="comment">*</span><span class="comment">          element in (X(j) - XTRUE) divided by the magnitude of the
</span><span class="comment">*</span><span class="comment">          largest element in X(j).  The estimate is as reliable as
</span><span class="comment">*</span><span class="comment">          the estimate for RCOND, and is almost always a slight
</span><span class="comment">*</span><span class="comment">          overestimate of the true error.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  BERR    (output) REAL array, dimension (NRHS)
</span><span class="comment">*</span><span class="comment">          The componentwise relative backward error of each solution
</span><span class="comment">*</span><span class="comment">          vector X(j) (i.e., the smallest relative change in
</span><span class="comment">*</span><span class="comment">          any element of A or B that makes X(j) an exact solution).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  WORK    (workspace) COMPLEX array, dimension (2*N)
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  RWORK   (workspace) REAL array, dimension (N)
</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">          &lt; 0: if INFO = -i, the i-th argument had an illegal value
</span><span class="comment">*</span><span class="comment">          &gt; 0: if INFO = i, and i is
</span><span class="comment">*</span><span class="comment">                &lt;= N:  the leading minor of order i of A is
</span><span class="comment">*</span><span class="comment">                       not positive definite, so the factorization
</span><span class="comment">*</span><span class="comment">                       could not be completed, and the solution has not
</span><span class="comment">*</span><span class="comment">                       been computed. RCOND = 0 is returned.
</span><span class="comment">*</span><span class="comment">                = N+1: U is nonsingular, but RCOND is less than machine
</span><span class="comment">*</span><span class="comment">                       precision, meaning that the matrix is singular
</span><span class="comment">*</span><span class="comment">                       to working precision.  Nevertheless, the
</span><span class="comment">*</span><span class="comment">                       solution and error bounds are computed because
</span><span class="comment">*</span><span class="comment">                       there are a number of situations where the
</span><span class="comment">*</span><span class="comment">                       computed solution can be more accurate than the
</span><span class="comment">*</span><span class="comment">                       value of RCOND would suggest.
</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 band storage scheme is illustrated by the following example, when
</span><span class="comment">*</span><span class="comment">  N = 6, KD = 2, and UPLO = 'U':
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  Two-dimensional storage of the Hermitian matrix A:
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     a11  a12  a13
</span><span class="comment">*</span><span class="comment">          a22  a23  a24
</span><span class="comment">*</span><span class="comment">               a33  a34  a35
</span><span class="comment">*</span><span class="comment">                    a44  a45  a46
</span><span class="comment">*</span><span class="comment">                         a55  a56
</span><span class="comment">*</span><span class="comment">     (aij=conjg(aji))         a66
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  Band storage of the upper triangle of A:
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">      *    *   a13  a24  a35  a46
</span><span class="comment">*</span><span class="comment">      *   a12  a23  a34  a45  a56
</span><span class="comment">*</span><span class="comment">     a11  a22  a33  a44  a55  a66
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  Similarly, if UPLO = 'L' the format of A is as follows:
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     a11  a22  a33  a44  a55  a66
</span><span class="comment">*</span><span class="comment">     a21  a32  a43  a54  a65   *
</span><span class="comment">*</span><span class="comment">     a31  a42  a53  a64   *    *
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  Array elements marked * are not used by the routine.
</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">     .. Parameters ..
</span>      REAL               ZERO, ONE
      PARAMETER          ( ZERO = 0.0E+0, ONE = 1.0E+0 )
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Local Scalars ..
</span>      LOGICAL            EQUIL, NOFACT, RCEQU, UPPER
      INTEGER            I, INFEQU, J, J1, J2
      REAL               AMAX, ANORM, BIGNUM, SCOND, SMAX, SMIN, SMLNUM
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. External Functions ..
</span>      LOGICAL            <a name="LSAME.251"></a><a href="lsame.f.html#LSAME.1">LSAME</a>
      REAL               <a name="CLANHB.252"></a><a href="clanhb.f.html#CLANHB.1">CLANHB</a>, <a name="SLAMCH.252"></a><a href="slamch.f.html#SLAMCH.1">SLAMCH</a>
      EXTERNAL           <a name="LSAME.253"></a><a href="lsame.f.html#LSAME.1">LSAME</a>, <a name="CLANHB.253"></a><a href="clanhb.f.html#CLANHB.1">CLANHB</a>, <a name="SLAMCH.253"></a><a href="slamch.f.html#SLAMCH.1">SLAMCH</a>
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. External Subroutines ..
</span>      EXTERNAL           CCOPY, <a name="CLACPY.256"></a><a href="clacpy.f.html#CLACPY.1">CLACPY</a>, <a name="CLAQHB.256"></a><a href="claqhb.f.html#CLAQHB.1">CLAQHB</a>, <a name="CPBCON.256"></a><a href="cpbcon.f.html#CPBCON.1">CPBCON</a>, <a name="CPBEQU.256"></a><a href="cpbequ.f.html#CPBEQU.1">CPBEQU</a>, <a name="CPBRFS.256"></a><a href="cpbrfs.f.html#CPBRFS.1">CPBRFS</a>,
     $                   <a name="CPBTRF.257"></a><a href="cpbtrf.f.html#CPBTRF.1">CPBTRF</a>, <a name="CPBTRS.257"></a><a href="cpbtrs.f.html#CPBTRS.1">CPBTRS</a>, <a name="XERBLA.257"></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">     .. Intrinsic Functions ..
</span>      INTRINSIC          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>      INFO = 0
      NOFACT = <a name="LSAME.265"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( FACT, <span class="string">'N'</span> )
      EQUIL = <a name="LSAME.266"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( FACT, <span class="string">'E'</span> )
      UPPER = <a name="LSAME.267"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( UPLO, <span class="string">'U'</span> )
      IF( NOFACT .OR. EQUIL ) THEN
         EQUED = <span class="string">'N'</span>
         RCEQU = .FALSE.
      ELSE
         RCEQU = <a name="LSAME.272"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( EQUED, <span class="string">'Y'</span> )
         SMLNUM = <a name="SLAMCH.273"></a><a href="slamch.f.html#SLAMCH.1">SLAMCH</a>( <span class="string">'Safe minimum'</span> )
         BIGNUM = ONE / SMLNUM
      END IF
<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>      IF( .NOT.NOFACT .AND. .NOT.EQUIL .AND. .NOT.<a name="LSAME.279"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( FACT, <span class="string">'F'</span> ) )

⌨️ 快捷键说明

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