sggevx.f.html
来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 741 行 · 第 1/4 页
HTML
741 行
</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) REAL 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) REAL
</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) REAL
</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) REAL 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) REAL 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) REAL 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 >= 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 >= max(1,6*N).
</span><span class="comment">*</span><span class="comment"> If SENSE = 'E', LWORK >= max(1,10*N).
</span><span class="comment">*</span><span class="comment"> If SENSE = 'V' or 'B', LWORK >= 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"> < 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"> > N: =N+1: other than QZ iteration failed in <a name="SHGEQZ.234"></a><a href="shgeqz.f.html#SHGEQZ.1">SHGEQZ</a>.
</span><span class="comment">*</span><span class="comment"> =N+2: error return from <a name="STGEVC.235"></a><a href="stgevc.f.html#STGEVC.1">STGEVC</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) <= 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> 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 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
REAL 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="SGEQRF.283"></a><a href="sgeqrf.f.html#SGEQRF.1">SGEQRF</a>, <a name="SGGBAK.283"></a><a href="sggbak.f.html#SGGBAK.1">SGGBAK</a>, <a name="SGGBAL.283"></a><a href="sggbal.f.html#SGGBAL.1">SGGBAL</a>, <a name="SGGHRD.283"></a><a href="sgghrd.f.html#SGGHRD.1">SGGHRD</a>, <a name="SHGEQZ.283"></a><a href="shgeqz.f.html#SHGEQZ.1">SHGEQZ</a>, <a name="SLABAD.283"></a><a href="slabad.f.html#SLABAD.1">SLABAD</a>,
$ <a name="SLACPY.284"></a><a href="slacpy.f.html#SLACPY.1">SLACPY</a>, <a name="SLASCL.284"></a><a href="slascl.f.html#SLASCL.1">SLASCL</a>, <a name="SLASET.284"></a><a href="slaset.f.html#SLASET.1">SLASET</a>, <a name="SORGQR.284"></a><a href="sorgqr.f.html#SORGQR.1">SORGQR</a>, <a name="SORMQR.284"></a><a href="sormqr.f.html#SORMQR.1">SORMQR</a>, <a name="STGEVC.284"></a><a href="stgevc.f.html#STGEVC.1">STGEVC</a>,
$ <a name="STGSNA.285"></a><a href="stgsna.f.html#STGSNA.1">STGSNA</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>
REAL <a name="SLAMCH.290"></a><a href="slamch.f.html#SLAMCH.1">SLAMCH</a>, <a name="SLANGE.290"></a><a href="slange.f.html#SLANGE.1">SLANGE</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="SLAMCH.291"></a><a href="slamch.f.html#SLAMCH.1">SLAMCH</a>, <a name="SLANGE.291"></a><a href="slange.f.html#SLANGE.1">SLANGE</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.( NOSCL .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">'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
END IF
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?