dlaln2.f.html

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

HTML
532
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
 <head>
  <title>dlaln2.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="DLALN2.1"></a><a href="dlaln2.f.html#DLALN2.1">DLALN2</a>( LTRANS, NA, NW, SMIN, CA, A, LDA, D1, D2, B,
     $                   LDB, WR, WI, X, LDX, SCALE, XNORM, INFO )
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  -- LAPACK auxiliary 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>      LOGICAL            LTRANS
      INTEGER            INFO, LDA, LDB, LDX, NA, NW
      DOUBLE PRECISION   CA, D1, D2, SCALE, SMIN, WI, WR, XNORM
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Array Arguments ..
</span>      DOUBLE PRECISION   A( LDA, * ), B( LDB, * ), 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="DLALN2.20"></a><a href="dlaln2.f.html#DLALN2.1">DLALN2</a> solves a system of the form  (ca A - w D ) X = s B
</span><span class="comment">*</span><span class="comment">  or (ca A' - w D) X = s B   with possible scaling (&quot;s&quot;) and
</span><span class="comment">*</span><span class="comment">  perturbation of A.  (A' means A-transpose.)
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  A is an NA x NA real matrix, ca is a real scalar, D is an NA x NA
</span><span class="comment">*</span><span class="comment">  real diagonal matrix, w is a real or complex value, and X and B are
</span><span class="comment">*</span><span class="comment">  NA x 1 matrices -- real if w is real, complex if w is complex.  NA
</span><span class="comment">*</span><span class="comment">  may be 1 or 2.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  If w is complex, X and B are represented as NA x 2 matrices,
</span><span class="comment">*</span><span class="comment">  the first column of each being the real part and the second
</span><span class="comment">*</span><span class="comment">  being the imaginary part.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  &quot;s&quot; is a scaling factor (.LE. 1), computed by <a name="DLALN2.33"></a><a href="dlaln2.f.html#DLALN2.1">DLALN2</a>, which is
</span><span class="comment">*</span><span class="comment">  so chosen that X can be computed without overflow.  X is further
</span><span class="comment">*</span><span class="comment">  scaled if necessary to assure that norm(ca A - w D)*norm(X) is less
</span><span class="comment">*</span><span class="comment">  than overflow.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  If both singular values of (ca A - w D) are less than SMIN,
</span><span class="comment">*</span><span class="comment">  SMIN*identity will be used instead of (ca A - w D).  If only one
</span><span class="comment">*</span><span class="comment">  singular value is less than SMIN, one element of (ca A - w D) will be
</span><span class="comment">*</span><span class="comment">  perturbed enough to make the smallest singular value roughly SMIN.
</span><span class="comment">*</span><span class="comment">  If both singular values are at least SMIN, (ca A - w D) will not be
</span><span class="comment">*</span><span class="comment">  perturbed.  In any case, the perturbation will be at most some small
</span><span class="comment">*</span><span class="comment">  multiple of max( SMIN, ulp*norm(ca A - w D) ).  The singular values
</span><span class="comment">*</span><span class="comment">  are computed by infinity-norm approximations, and thus will only be
</span><span class="comment">*</span><span class="comment">  correct to a factor of 2 or so.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  Note: all input quantities are assumed to be smaller than overflow
</span><span class="comment">*</span><span class="comment">  by a reasonable factor.  (See BIGNUM.)
</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">  LTRANS  (input) LOGICAL
</span><span class="comment">*</span><span class="comment">          =.TRUE.:  A-transpose will be used.
</span><span class="comment">*</span><span class="comment">          =.FALSE.: A will be used (not transposed.)
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  NA      (input) INTEGER
</span><span class="comment">*</span><span class="comment">          The size of the matrix A.  It may (only) be 1 or 2.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  NW      (input) INTEGER
</span><span class="comment">*</span><span class="comment">          1 if &quot;w&quot; is real, 2 if &quot;w&quot; is complex.  It may only be 1
</span><span class="comment">*</span><span class="comment">          or 2.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  SMIN    (input) DOUBLE PRECISION
</span><span class="comment">*</span><span class="comment">          The desired lower bound on the singular values of A.  This
</span><span class="comment">*</span><span class="comment">          should be a safe distance away from underflow or overflow,
</span><span class="comment">*</span><span class="comment">          say, between (underflow/machine precision) and  (machine
</span><span class="comment">*</span><span class="comment">          precision * overflow ).  (See BIGNUM and ULP.)
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  CA      (input) DOUBLE PRECISION
</span><span class="comment">*</span><span class="comment">          The coefficient c, which A is multiplied by.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  A       (input) DOUBLE PRECISION array, dimension (LDA,NA)
</span><span class="comment">*</span><span class="comment">          The NA x NA matrix A.
</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 A.  It must be at least NA.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  D1      (input) DOUBLE PRECISION
</span><span class="comment">*</span><span class="comment">          The 1,1 element in the diagonal matrix D.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  D2      (input) DOUBLE PRECISION
</span><span class="comment">*</span><span class="comment">          The 2,2 element in the diagonal matrix D.  Not used if NW=1.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  B       (input) DOUBLE PRECISION array, dimension (LDB,NW)
</span><span class="comment">*</span><span class="comment">          The NA x NW matrix B (right-hand side).  If NW=2 (&quot;w&quot; is
</span><span class="comment">*</span><span class="comment">          complex), column 1 contains the real part of B and column 2
</span><span class="comment">*</span><span class="comment">          contains the imaginary part.
</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 B.  It must be at least NA.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  WR      (input) DOUBLE PRECISION
</span><span class="comment">*</span><span class="comment">          The real part of the scalar &quot;w&quot;.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  WI      (input) DOUBLE PRECISION
</span><span class="comment">*</span><span class="comment">          The imaginary part of the scalar &quot;w&quot;.  Not used if NW=1.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  X       (output) DOUBLE PRECISION array, dimension (LDX,NW)
</span><span class="comment">*</span><span class="comment">          The NA x NW matrix X (unknowns), as computed by <a name="DLALN2.101"></a><a href="dlaln2.f.html#DLALN2.1">DLALN2</a>.
</span><span class="comment">*</span><span class="comment">          If NW=2 (&quot;w&quot; is complex), on exit, column 1 will contain
</span><span class="comment">*</span><span class="comment">          the real part of X and column 2 will contain the imaginary
</span><span class="comment">*</span><span class="comment">          part.
</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 X.  It must be at least NA.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  SCALE   (output) DOUBLE PRECISION
</span><span class="comment">*</span><span class="comment">          The scale factor that B must be multiplied by to insure
</span><span class="comment">*</span><span class="comment">          that overflow does not occur when computing X.  Thus,
</span><span class="comment">*</span><span class="comment">          (ca A - w D) X  will be SCALE*B, not B (ignoring
</span><span class="comment">*</span><span class="comment">          perturbations of A.)  It will be at most 1.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  XNORM   (output) DOUBLE PRECISION
</span><span class="comment">*</span><span class="comment">          The infinity-norm of X, when X is regarded as an NA x NW
</span><span class="comment">*</span><span class="comment">          real matrix.
</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">          An error flag.  It will be set to zero if no error occurs,
</span><span class="comment">*</span><span class="comment">          a negative number if an argument is in error, or a positive
</span><span class="comment">*</span><span class="comment">          number if  ca A - w D  had to be perturbed.
</span><span class="comment">*</span><span class="comment">          The possible values are:
</span><span class="comment">*</span><span class="comment">          = 0: No error occurred, and (ca A - w D) did not have to be
</span><span class="comment">*</span><span class="comment">                 perturbed.
</span><span class="comment">*</span><span class="comment">          = 1: (ca A - w D) had to be perturbed to make its smallest
</span><span class="comment">*</span><span class="comment">               (or only) singular value greater than SMIN.
</span><span class="comment">*</span><span class="comment">          NOTE: In the interests of speed, this routine does not
</span><span class="comment">*</span><span class="comment">                check the inputs for errors.
</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.0D0, ONE = 1.0D0 )
      DOUBLE PRECISION   TWO
      PARAMETER          ( TWO = 2.0D0 )
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Local Scalars ..
</span>      INTEGER            ICMAX, J
      DOUBLE PRECISION   BBND, BI1, BI2, BIGNUM, BNORM, BR1, BR2, CI21,
     $                   CI22, CMAX, CNORM, CR21, CR22, CSI, CSR, LI21,
     $                   LR21, SMINI, SMLNUM, TEMP, U22ABS, UI11, UI11R,
     $                   UI12, UI12S, UI22, UR11, UR11R, UR12, UR12S,
     $                   UR22, XI1, XI2, XR1, XR2
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Local Arrays ..
</span>      LOGICAL            RSWAP( 4 ), ZSWAP( 4 )
      INTEGER            IPIVOT( 4, 4 )
      DOUBLE PRECISION   CI( 2, 2 ), CIV( 4 ), CR( 2, 2 ), CRV( 4 )
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. External Functions ..
</span>      DOUBLE PRECISION   <a name="DLAMCH.153"></a><a href="dlamch.f.html#DLAMCH.1">DLAMCH</a>
      EXTERNAL           <a name="DLAMCH.154"></a><a href="dlamch.f.html#DLAMCH.1">DLAMCH</a>
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. External Subroutines ..
</span>      EXTERNAL           <a name="DLADIV.157"></a><a href="dladiv.f.html#DLADIV.1">DLADIV</a>
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Intrinsic Functions ..

⌨️ 快捷键说明

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