cposvx.f.html

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

HTML
401
字号
</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 triangular factor U or L from the Cholesky
</span><span class="comment">*</span><span class="comment">          factorization A = U**H*U or A = L*L**H, in the same storage
</span><span class="comment">*</span><span class="comment">          format as A.  If EQUED .ne. 'N', then AF is the factored form
</span><span class="comment">*</span><span class="comment">          of the equilibrated matrix diag(S)*A*diag(S).
</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 triangular factor U or L from the Cholesky
</span><span class="comment">*</span><span class="comment">          factorization A = U**H*U or A = L*L**H of the original
</span><span class="comment">*</span><span class="comment">          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 triangular factor U or L from the Cholesky
</span><span class="comment">*</span><span class="comment">          factorization A = U**H*U or A = L*L**H of the equilibrated
</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">  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">  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 righthand 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">  =====================================================================
</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
      INTEGER            I, INFEQU, J
      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.221"></a><a href="lsame.f.html#LSAME.1">LSAME</a>
      REAL               <a name="CLANHE.222"></a><a href="clanhe.f.html#CLANHE.1">CLANHE</a>, <a name="SLAMCH.222"></a><a href="slamch.f.html#SLAMCH.1">SLAMCH</a>
      EXTERNAL           <a name="LSAME.223"></a><a href="lsame.f.html#LSAME.1">LSAME</a>, <a name="CLANHE.223"></a><a href="clanhe.f.html#CLANHE.1">CLANHE</a>, <a name="SLAMCH.223"></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           <a name="CLACPY.226"></a><a href="clacpy.f.html#CLACPY.1">CLACPY</a>, <a name="CLAQHE.226"></a><a href="claqhe.f.html#CLAQHE.1">CLAQHE</a>, <a name="CPOCON.226"></a><a href="cpocon.f.html#CPOCON.1">CPOCON</a>, <a name="CPOEQU.226"></a><a href="cpoequ.f.html#CPOEQU.1">CPOEQU</a>, <a name="CPORFS.226"></a><a href="cporfs.f.html#CPORFS.1">CPORFS</a>, <a name="CPOTRF.226"></a><a href="cpotrf.f.html#CPOTRF.1">CPOTRF</a>,
     $                   <a name="CPOTRS.227"></a><a href="cpotrs.f.html#CPOTRS.1">CPOTRS</a>, <a name="XERBLA.227"></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.235"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( FACT, <span class="string">'N'</span> )
      EQUIL = <a name="LSAME.236"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( FACT, <span class="string">'E'</span> )
      IF( NOFACT .OR. EQUIL ) THEN
         EQUED = <span class="string">'N'</span>
         RCEQU = .FALSE.
      ELSE
         RCEQU = <a name="LSAME.241"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( EQUED, <span class="string">'Y'</span> )
         SMLNUM = <a name="SLAMCH.242"></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.248"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( FACT, <span class="string">'F'</span> ) )
     $     THEN

⌨️ 快捷键说明

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