dposvx.f.html

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

HTML
402
字号
</span><span class="comment">*</span><span class="comment">  AF      (input or output) DOUBLE PRECISION 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 triangular factor U or L from the Cholesky
</span><span class="comment">*</span><span class="comment">          factorization A = U**T*U or A = L*L**T, 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**T*U or A = L*L**T 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**T*U or A = L*L**T 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) DOUBLE PRECISION 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) DOUBLE PRECISION 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) DOUBLE PRECISION 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) DOUBLE PRECISION
</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) DOUBLE PRECISION 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) DOUBLE PRECISION 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) DOUBLE PRECISION array, dimension (3*N)
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  IWORK   (workspace) INTEGER 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>      DOUBLE PRECISION   ZERO, ONE
      PARAMETER          ( ZERO = 0.0D+0, ONE = 1.0D+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
      DOUBLE PRECISION   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.222"></a><a href="lsame.f.html#LSAME.1">LSAME</a>
      DOUBLE PRECISION   <a name="DLAMCH.223"></a><a href="dlamch.f.html#DLAMCH.1">DLAMCH</a>, <a name="DLANSY.223"></a><a href="dlansy.f.html#DLANSY.1">DLANSY</a>
      EXTERNAL           <a name="LSAME.224"></a><a href="lsame.f.html#LSAME.1">LSAME</a>, <a name="DLAMCH.224"></a><a href="dlamch.f.html#DLAMCH.1">DLAMCH</a>, <a name="DLANSY.224"></a><a href="dlansy.f.html#DLANSY.1">DLANSY</a>
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. External Subroutines ..
</span>      EXTERNAL           <a name="DLACPY.227"></a><a href="dlacpy.f.html#DLACPY.1">DLACPY</a>, <a name="DLAQSY.227"></a><a href="dlaqsy.f.html#DLAQSY.1">DLAQSY</a>, <a name="DPOCON.227"></a><a href="dpocon.f.html#DPOCON.1">DPOCON</a>, <a name="DPOEQU.227"></a><a href="dpoequ.f.html#DPOEQU.1">DPOEQU</a>, <a name="DPORFS.227"></a><a href="dporfs.f.html#DPORFS.1">DPORFS</a>, <a name="DPOTRF.227"></a><a href="dpotrf.f.html#DPOTRF.1">DPOTRF</a>,
     $                   <a name="DPOTRS.228"></a><a href="dpotrs.f.html#DPOTRS.1">DPOTRS</a>, <a name="XERBLA.228"></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.236"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( FACT, <span class="string">'N'</span> )
      EQUIL = <a name="LSAME.237"></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.242"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( EQUED, <span class="string">'Y'</span> )
         SMLNUM = <a name="DLAMCH.243"></a><a href="dlamch.f.html#DLAMCH.1">DLAMCH</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.249"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( FACT, <span class="string">'F'</span> ) )

⌨️ 快捷键说明

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