dgeevx.f.html

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

HTML
581
字号
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  VR      (output) DOUBLE PRECISION array, dimension (LDVR,N)
</span><span class="comment">*</span><span class="comment">          If JOBVR = 'V', the right eigenvectors v(j) are stored one
</span><span class="comment">*</span><span class="comment">          after another in the columns of VR, in the same order
</span><span class="comment">*</span><span class="comment">          as their eigenvalues.
</span><span class="comment">*</span><span class="comment">          If JOBVR = 'N', VR is not referenced.
</span><span class="comment">*</span><span class="comment">          If the j-th eigenvalue is real, then v(j) = VR(:,j),
</span><span class="comment">*</span><span class="comment">          the j-th column of VR.
</span><span class="comment">*</span><span class="comment">          If the j-th and (j+1)-st eigenvalues form a complex
</span><span class="comment">*</span><span class="comment">          conjugate pair, then v(j) = VR(:,j) + i*VR(:,j+1) and
</span><span class="comment">*</span><span class="comment">          v(j+1) = VR(:,j) - i*VR(:,j+1).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  LDVR    (input) INTEGER
</span><span class="comment">*</span><span class="comment">          The leading dimension of the array VR.  LDVR &gt;= 1, and if
</span><span class="comment">*</span><span class="comment">          JOBVR = 'V', LDVR &gt;= N.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  ILO     (output) INTEGER
</span><span class="comment">*</span><span class="comment">  IHI     (output) INTEGER
</span><span class="comment">*</span><span class="comment">          ILO and IHI are integer values determined when A was
</span><span class="comment">*</span><span class="comment">          balanced.  The balanced A(i,j) = 0 if I &gt; J and
</span><span class="comment">*</span><span class="comment">          J = 1,...,ILO-1 or I = IHI+1,...,N.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  SCALE   (output) DOUBLE PRECISION array, dimension (N)
</span><span class="comment">*</span><span class="comment">          Details of the permutations and scaling factors applied
</span><span class="comment">*</span><span class="comment">          when balancing A.  If P(j) is the index of the row and column
</span><span class="comment">*</span><span class="comment">          interchanged with row and column j, and D(j) is the scaling
</span><span class="comment">*</span><span class="comment">          factor applied to row and column j, then
</span><span class="comment">*</span><span class="comment">          SCALE(J) = P(J),    for J = 1,...,ILO-1
</span><span class="comment">*</span><span class="comment">                   = D(J),    for J = ILO,...,IHI
</span><span class="comment">*</span><span class="comment">                   = P(J)     for J = IHI+1,...,N.
</span><span class="comment">*</span><span class="comment">          The order in which the interchanges are made is N to IHI+1,
</span><span class="comment">*</span><span class="comment">          then 1 to ILO-1.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  ABNRM   (output) DOUBLE PRECISION
</span><span class="comment">*</span><span class="comment">          The one-norm of the balanced matrix (the maximum
</span><span class="comment">*</span><span class="comment">          of the sum of absolute values of elements of any column).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  RCONDE  (output) DOUBLE PRECISION array, dimension (N)
</span><span class="comment">*</span><span class="comment">          RCONDE(j) is the reciprocal condition number of the j-th
</span><span class="comment">*</span><span class="comment">          eigenvalue.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  RCONDV  (output) DOUBLE PRECISION array, dimension (N)
</span><span class="comment">*</span><span class="comment">          RCONDV(j) is the reciprocal condition number of the j-th
</span><span class="comment">*</span><span class="comment">          right eigenvector.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  WORK    (workspace/output) DOUBLE PRECISION array, dimension (MAX(1,LWORK))
</span><span class="comment">*</span><span class="comment">          On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  LWORK   (input) INTEGER
</span><span class="comment">*</span><span class="comment">          The dimension of the array WORK.   If SENSE = 'N' or 'E',
</span><span class="comment">*</span><span class="comment">          LWORK &gt;= max(1,2*N), and if JOBVL = 'V' or JOBVR = 'V',
</span><span class="comment">*</span><span class="comment">          LWORK &gt;= 3*N.  If SENSE = 'V' or 'B', LWORK &gt;= N*(N+6).
</span><span class="comment">*</span><span class="comment">          For good performance, LWORK must generally be larger.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">          If LWORK = -1, then a workspace query is assumed; the routine
</span><span class="comment">*</span><span class="comment">          only calculates the optimal size of the WORK array, returns
</span><span class="comment">*</span><span class="comment">          this value as the first entry of the WORK array, and no error
</span><span class="comment">*</span><span class="comment">          message related to LWORK is issued by <a name="XERBLA.185"></a><a href="xerbla.f.html#XERBLA.1">XERBLA</a>.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  IWORK   (workspace) INTEGER array, dimension (2*N-2)
</span><span class="comment">*</span><span class="comment">          If SENSE = 'N' or 'E', not referenced.
</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, the QR algorithm failed to compute all the
</span><span class="comment">*</span><span class="comment">                eigenvalues, and no eigenvectors or condition numbers
</span><span class="comment">*</span><span class="comment">                have been computed; elements 1:ILO-1 and i+1:N of WR
</span><span class="comment">*</span><span class="comment">                and WI contain eigenvalues which have converged.
</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 )
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Local Scalars ..
</span>      LOGICAL            LQUERY, SCALEA, WANTVL, WANTVR, WNTSNB, WNTSNE,
     $                   WNTSNN, WNTSNV
      CHARACTER          JOB, SIDE
      INTEGER            HSWORK, I, ICOND, IERR, ITAU, IWRK, K, MAXWRK,
     $                   MINWRK, NOUT
      DOUBLE PRECISION   ANRM, BIGNUM, CS, CSCALE, EPS, R, SCL, SMLNUM,
     $                   SN
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Local Arrays ..
</span>      LOGICAL            SELECT( 1 )
      DOUBLE PRECISION   DUM( 1 )
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. External Subroutines ..
</span>      EXTERNAL           <a name="DGEBAK.218"></a><a href="dgebak.f.html#DGEBAK.1">DGEBAK</a>, <a name="DGEBAL.218"></a><a href="dgebal.f.html#DGEBAL.1">DGEBAL</a>, <a name="DGEHRD.218"></a><a href="dgehrd.f.html#DGEHRD.1">DGEHRD</a>, <a name="DHSEQR.218"></a><a href="dhseqr.f.html#DHSEQR.1">DHSEQR</a>, <a name="DLABAD.218"></a><a href="dlabad.f.html#DLABAD.1">DLABAD</a>, <a name="DLACPY.218"></a><a href="dlacpy.f.html#DLACPY.1">DLACPY</a>,
     $                   <a name="DLARTG.219"></a><a href="dlartg.f.html#DLARTG.1">DLARTG</a>, <a name="DLASCL.219"></a><a href="dlascl.f.html#DLASCL.1">DLASCL</a>, <a name="DORGHR.219"></a><a href="dorghr.f.html#DORGHR.1">DORGHR</a>, DROT, DSCAL, <a name="DTREVC.219"></a><a href="dtrevc.f.html#DTREVC.1">DTREVC</a>,
     $                   <a name="DTRSNA.220"></a><a href="dtrsna.f.html#DTRSNA.1">DTRSNA</a>, <a name="XERBLA.220"></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">     .. External Functions ..
</span>      LOGICAL            <a name="LSAME.223"></a><a href="lsame.f.html#LSAME.1">LSAME</a>
      INTEGER            IDAMAX, <a name="ILAENV.224"></a><a href="hfy-index.html#ILAENV">ILAENV</a>
      DOUBLE PRECISION   <a name="DLAMCH.225"></a><a href="dlamch.f.html#DLAMCH.1">DLAMCH</a>, <a name="DLANGE.225"></a><a href="dlange.f.html#DLANGE.1">DLANGE</a>, <a name="DLAPY2.225"></a><a href="dlapy2.f.html#DLAPY2.1">DLAPY2</a>, DNRM2
      EXTERNAL           <a name="LSAME.226"></a><a href="lsame.f.html#LSAME.1">LSAME</a>, IDAMAX, <a name="ILAENV.226"></a><a href="hfy-index.html#ILAENV">ILAENV</a>, <a name="DLAMCH.226"></a><a href="dlamch.f.html#DLAMCH.1">DLAMCH</a>, <a name="DLANGE.226"></a><a href="dlange.f.html#DLANGE.1">DLANGE</a>, <a name="DLAPY2.226"></a><a href="dlapy2.f.html#DLAPY2.1">DLAPY2</a>,
     $                   DNRM2
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Intrinsic Functions ..
</span>      INTRINSIC          MAX, SQRT
<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><span class="comment">*</span><span class="comment">     Test the input arguments
</span><span class="comment">*</span><span class="comment">
</span>      INFO = 0
      LQUERY = ( LWORK.EQ.-1 )
      WANTVL = <a name="LSAME.238"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( JOBVL, <span class="string">'V'</span> )
      WANTVR = <a name="LSAME.239"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( JOBVR, <span class="string">'V'</span> )
      WNTSNN = <a name="LSAME.240"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( SENSE, <span class="string">'N'</span> )
      WNTSNE = <a name="LSAME.241"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( SENSE, <span class="string">'E'</span> )
      WNTSNV = <a name="LSAME.242"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( SENSE, <span class="string">'V'</span> )
      WNTSNB = <a name="LSAME.243"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( SENSE, <span class="string">'B'</span> )
      IF( .NOT.( <a name="LSAME.244"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( BALANC, <span class="string">'N'</span> ) .OR. <a name="LSAME.244"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( BALANC,
     $    <span class="string">'S'</span> ) .OR. <a name="LSAME.245"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( BALANC, <span class="string">'P'</span> ) .OR. <a name="LSAME.245"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( BALANC, <span class="string">'B'</span> ) ) )
     $     THEN
         INFO = -1
      ELSE IF( ( .NOT.WANTVL ) .AND. ( .NOT.<a name="LSAME.248"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( JOBVL, <span class="string">'N'</span> ) ) ) THEN
         INFO = -2
      ELSE IF( ( .NOT.WANTVR ) .AND. ( .NOT.<a name="LSAME.250"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( JOBVR, <span class="string">'N'</span> ) ) ) THEN
         INFO = -3
      ELSE IF( .NOT.( WNTSNN .OR. WNTSNE .OR. WNTSNB .OR. WNTSNV ) .OR.
     $         ( ( WNTSNE .OR. WNTSNB ) .AND. .NOT.( WANTVL .AND.
     $         WANTVR ) ) ) THEN
         INFO = -4
      ELSE IF( N.LT.0 ) THEN
         INFO = -5
      ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
         INFO = -7
      ELSE IF( LDVL.LT.1 .OR. ( WANTVL .AND. LDVL.LT.N ) ) THEN
         INFO = -11
      ELSE IF( LDVR.LT.1 .OR. ( WANTVR .AND. LDVR.LT.N ) ) THEN
         INFO = -13
      END IF
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     Compute workspace
</span><span class="comment">*</span><span class="comment">      (Note: Comments in the code beginning &quot;Workspace:&quot; describe the
</span><span class="comment">*</span><span class="comment">       minimal amount of workspace needed at that point in the code,
</span><span class="comment">*</span><span class="comment">       as well as the preferred amount for good performance.
</span><span class="comment">*</span><span class="comment">       NB refers to the optimal block size for the immediately
</span><span class="comment">*</span><span class="comment">       following subroutine, as returned by <a name="ILAENV.271"></a><a href="hfy-index.html#ILAENV">ILAENV</a>.
</span><span class="comment">*</span><span class="comment">       HSWORK refers to the workspace preferred by <a name="DHSEQR.272"></a><a href="dhseqr.f.html#DHSEQR.1">DHSEQR</a>, as
</span><span class="comment">*</span><span class="comment">       calculated below. HSWORK is computed assuming ILO=1 and IHI=N,

⌨️ 快捷键说明

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