dggevx.f.html

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

HTML
743
字号
</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">  RSCALE  (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">          to the right side of A and B.  If PR(j) is the index of the
</span><span class="comment">*</span><span class="comment">          column interchanged with column j, and DR(j) is the scaling
</span><span class="comment">*</span><span class="comment">          factor applied to column j, then
</span><span class="comment">*</span><span class="comment">            RSCALE(j) = PR(j)  for j = 1,...,ILO-1
</span><span class="comment">*</span><span class="comment">                      = DR(j)  for j = ILO,...,IHI
</span><span class="comment">*</span><span class="comment">                      = PR(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 A.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  BBNRM   (output) DOUBLE PRECISION
</span><span class="comment">*</span><span class="comment">          The one-norm of the balanced matrix B.
</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">          If SENSE = 'E' or 'B', the reciprocal condition numbers of
</span><span class="comment">*</span><span class="comment">          the eigenvalues, stored in consecutive elements of the array.
</span><span class="comment">*</span><span class="comment">          For a complex conjugate pair of eigenvalues two consecutive
</span><span class="comment">*</span><span class="comment">          elements of RCONDE are set to the same value. Thus RCONDE(j),
</span><span class="comment">*</span><span class="comment">          RCONDV(j), and the j-th columns of VL and VR all correspond
</span><span class="comment">*</span><span class="comment">          to the j-th eigenpair.
</span><span class="comment">*</span><span class="comment">          If SENSE = 'N or 'V', RCONDE is not referenced.
</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">          If SENSE = 'V' or 'B', the estimated reciprocal condition
</span><span class="comment">*</span><span class="comment">          numbers of the eigenvectors, stored in consecutive elements
</span><span class="comment">*</span><span class="comment">          of the array. For a complex eigenvector two consecutive
</span><span class="comment">*</span><span class="comment">          elements of RCONDV are set to the same value. If the
</span><span class="comment">*</span><span class="comment">          eigenvalues cannot be reordered to compute RCONDV(j),
</span><span class="comment">*</span><span class="comment">          RCONDV(j) is set to 0; this can only occur when the true
</span><span class="comment">*</span><span class="comment">          value would be very small anyway.
</span><span class="comment">*</span><span class="comment">          If SENSE = 'N' or 'E', RCONDV is not referenced.
</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. LWORK &gt;= max(1,2*N).
</span><span class="comment">*</span><span class="comment">          If BALANC = 'S' or 'B', or JOBVL = 'V', or JOBVR = 'V',
</span><span class="comment">*</span><span class="comment">          LWORK &gt;= max(1,6*N).
</span><span class="comment">*</span><span class="comment">          If SENSE = 'E' or 'B', LWORK &gt;= max(1,10*N).
</span><span class="comment">*</span><span class="comment">          If SENSE = 'V' or 'B', LWORK &gt;= 2*N*N+8*N+16.
</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.219"></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 (N+6)
</span><span class="comment">*</span><span class="comment">          If SENSE = 'E', IWORK is not referenced.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  BWORK   (workspace) LOGICAL array, dimension (N)
</span><span class="comment">*</span><span class="comment">          If SENSE = 'N', BWORK is 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">          = 1,...,N:
</span><span class="comment">*</span><span class="comment">                The QZ iteration failed.  No eigenvectors have been
</span><span class="comment">*</span><span class="comment">                calculated, but ALPHAR(j), ALPHAI(j), and BETA(j)
</span><span class="comment">*</span><span class="comment">                should be correct for j=INFO+1,...,N.
</span><span class="comment">*</span><span class="comment">          &gt; N:  =N+1: other than QZ iteration failed in <a name="DHGEQZ.234"></a><a href="dhgeqz.f.html#DHGEQZ.1">DHGEQZ</a>.
</span><span class="comment">*</span><span class="comment">                =N+2: error return from <a name="DTGEVC.235"></a><a href="dtgevc.f.html#DTGEVC.1">DTGEVC</a>.
</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">  Balancing a matrix pair (A,B) includes, first, permuting rows and
</span><span class="comment">*</span><span class="comment">  columns to isolate eigenvalues, second, applying diagonal similarity
</span><span class="comment">*</span><span class="comment">  transformation to the rows and columns to make the rows and columns
</span><span class="comment">*</span><span class="comment">  as close in norm as possible. The computed reciprocal condition
</span><span class="comment">*</span><span class="comment">  numbers correspond to the balanced matrix. Permuting rows and columns
</span><span class="comment">*</span><span class="comment">  will not change the condition numbers (in exact arithmetic) but
</span><span class="comment">*</span><span class="comment">  diagonal scaling will.  For further explanation of balancing, see
</span><span class="comment">*</span><span class="comment">  section 4.11.1.2 of LAPACK Users' Guide.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  An approximate error bound on the chordal distance between the i-th
</span><span class="comment">*</span><span class="comment">  computed generalized eigenvalue w and the corresponding exact
</span><span class="comment">*</span><span class="comment">  eigenvalue lambda is
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">       chord(w, lambda) &lt;= EPS * norm(ABNRM, BBNRM) / RCONDE(I)
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  An approximate error bound for the angle between the i-th computed
</span><span class="comment">*</span><span class="comment">  eigenvector VL(i) or VR(i) is given by
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">       EPS * norm(ABNRM, BBNRM) / DIF(i).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  For further explanation of the reciprocal condition numbers RCONDE
</span><span class="comment">*</span><span class="comment">  and RCONDV, see section 4.11 of LAPACK User's Guide.
</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            ILASCL, ILBSCL, ILV, ILVL, ILVR, LQUERY, NOSCL,
     $                   PAIR, WANTSB, WANTSE, WANTSN, WANTSV
      CHARACTER          CHTEMP
      INTEGER            I, ICOLS, IERR, IJOBVL, IJOBVR, IN, IROWS,
     $                   ITAU, IWRK, IWRK1, J, JC, JR, M, MAXWRK,
     $                   MINWRK, MM
      DOUBLE PRECISION   ANRM, ANRMTO, BIGNUM, BNRM, BNRMTO, EPS,
     $                   SMLNUM, TEMP
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Local Arrays ..
</span>      LOGICAL            LDUMMA( 1 )
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. External Subroutines ..
</span>      EXTERNAL           <a name="DGEQRF.283"></a><a href="dgeqrf.f.html#DGEQRF.1">DGEQRF</a>, <a name="DGGBAK.283"></a><a href="dggbak.f.html#DGGBAK.1">DGGBAK</a>, <a name="DGGBAL.283"></a><a href="dggbal.f.html#DGGBAL.1">DGGBAL</a>, <a name="DGGHRD.283"></a><a href="dgghrd.f.html#DGGHRD.1">DGGHRD</a>, <a name="DHGEQZ.283"></a><a href="dhgeqz.f.html#DHGEQZ.1">DHGEQZ</a>, <a name="DLABAD.283"></a><a href="dlabad.f.html#DLABAD.1">DLABAD</a>,
     $                   <a name="DLACPY.284"></a><a href="dlacpy.f.html#DLACPY.1">DLACPY</a>, <a name="DLASCL.284"></a><a href="dlascl.f.html#DLASCL.1">DLASCL</a>, <a name="DLASET.284"></a><a href="dlaset.f.html#DLASET.1">DLASET</a>, <a name="DORGQR.284"></a><a href="dorgqr.f.html#DORGQR.1">DORGQR</a>, <a name="DORMQR.284"></a><a href="dormqr.f.html#DORMQR.1">DORMQR</a>, <a name="DTGEVC.284"></a><a href="dtgevc.f.html#DTGEVC.1">DTGEVC</a>,
     $                   <a name="DTGSNA.285"></a><a href="dtgsna.f.html#DTGSNA.1">DTGSNA</a>, <a name="XERBLA.285"></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.288"></a><a href="lsame.f.html#LSAME.1">LSAME</a>
      INTEGER            <a name="ILAENV.289"></a><a href="hfy-index.html#ILAENV">ILAENV</a>
      DOUBLE PRECISION   <a name="DLAMCH.290"></a><a href="dlamch.f.html#DLAMCH.1">DLAMCH</a>, <a name="DLANGE.290"></a><a href="dlange.f.html#DLANGE.1">DLANGE</a>
      EXTERNAL           <a name="LSAME.291"></a><a href="lsame.f.html#LSAME.1">LSAME</a>, <a name="ILAENV.291"></a><a href="hfy-index.html#ILAENV">ILAENV</a>, <a name="DLAMCH.291"></a><a href="dlamch.f.html#DLAMCH.1">DLAMCH</a>, <a name="DLANGE.291"></a><a href="dlange.f.html#DLANGE.1">DLANGE</a>
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Intrinsic Functions ..
</span>      INTRINSIC          ABS, 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">     Decode the input arguments
</span><span class="comment">*</span><span class="comment">
</span>      IF( <a name="LSAME.300"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( JOBVL, <span class="string">'N'</span> ) ) THEN
         IJOBVL = 1
         ILVL = .FALSE.
      ELSE IF( <a name="LSAME.303"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( JOBVL, <span class="string">'V'</span> ) ) THEN
         IJOBVL = 2
         ILVL = .TRUE.
      ELSE
         IJOBVL = -1
         ILVL = .FALSE.
      END IF
<span class="comment">*</span><span class="comment">
</span>      IF( <a name="LSAME.311"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( JOBVR, <span class="string">'N'</span> ) ) THEN
         IJOBVR = 1
         ILVR = .FALSE.
      ELSE IF( <a name="LSAME.314"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( JOBVR, <span class="string">'V'</span> ) ) THEN
         IJOBVR = 2
         ILVR = .TRUE.
      ELSE
         IJOBVR = -1
         ILVR = .FALSE.
      END IF
      ILV = ILVL .OR. ILVR
<span class="comment">*</span><span class="comment">
</span>      NOSCL  = <a name="LSAME.323"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( BALANC, <span class="string">'N'</span> ) .OR. <a name="LSAME.323"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( BALANC, <span class="string">'P'</span> )
      WANTSN = <a name="LSAME.324"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( SENSE, <span class="string">'N'</span> )
      WANTSE = <a name="LSAME.325"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( SENSE, <span class="string">'E'</span> )
      WANTSV = <a name="LSAME.326"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( SENSE, <span class="string">'V'</span> )
      WANTSB = <a name="LSAME.327"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( SENSE, <span class="string">'B'</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 )
      IF( .NOT.( <a name="LSAME.333"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( BALANC, <span class="string">'N'</span> ) .OR. <a name="LSAME.333"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( BALANC,
     $    <span class="string">'S'</span> ) .OR. <a name="LSAME.334"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( BALANC, <span class="string">'P'</span> ) .OR. <a name="LSAME.334"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( BALANC, <span class="string">'B'</span> ) ) )
     $     THEN
         INFO = -1
      ELSE IF( IJOBVL.LE.0 ) THEN
         INFO = -2
      ELSE IF( IJOBVR.LE.0 ) THEN
         INFO = -3
      ELSE IF( .NOT.( WANTSN .OR. WANTSE .OR. WANTSB .OR. WANTSV ) )
     $          THEN
         INFO = -4
      ELSE IF( N.LT.0 ) THEN
         INFO = -5
      ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
         INFO = -7
      ELSE IF( LDB.LT.MAX( 1, N ) ) THEN
         INFO = -9
      ELSE IF( LDVL.LT.1 .OR. ( ILVL .AND. LDVL.LT.N ) ) THEN
         INFO = -14
      ELSE IF( LDVR.LT.1 .OR. ( ILVR .AND. LDVR.LT.N ) ) THEN
         INFO = -16

⌨️ 快捷键说明

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