sggesx.f.html
来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 701 行 · 第 1/4 页
HTML
701 行
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> VSR (output) REAL array, dimension (LDVSR,N)
</span><span class="comment">*</span><span class="comment"> If JOBVSR = 'V', VSR will contain the right Schur vectors.
</span><span class="comment">*</span><span class="comment"> Not referenced if JOBVSR = 'N'.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> LDVSR (input) INTEGER
</span><span class="comment">*</span><span class="comment"> The leading dimension of the matrix VSR. LDVSR >= 1, and
</span><span class="comment">*</span><span class="comment"> if JOBVSR = 'V', LDVSR >= N.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> RCONDE (output) REAL array, dimension ( 2 )
</span><span class="comment">*</span><span class="comment"> If SENSE = 'E' or 'B', RCONDE(1) and RCONDE(2) contain the
</span><span class="comment">*</span><span class="comment"> reciprocal condition numbers for the average of the selected
</span><span class="comment">*</span><span class="comment"> eigenvalues.
</span><span class="comment">*</span><span class="comment"> Not referenced if SENSE = 'N' or 'V'.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> RCONDV (output) REAL array, dimension ( 2 )
</span><span class="comment">*</span><span class="comment"> If SENSE = 'V' or 'B', RCONDV(1) and RCONDV(2) contain the
</span><span class="comment">*</span><span class="comment"> reciprocal condition numbers for the selected deflating
</span><span class="comment">*</span><span class="comment"> subspaces.
</span><span class="comment">*</span><span class="comment"> Not referenced if SENSE = 'N' or 'E'.
</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.
</span><span class="comment">*</span><span class="comment"> If N = 0, LWORK >= 1, else if SENSE = 'E', 'V', or 'B',
</span><span class="comment">*</span><span class="comment"> LWORK >= max( 8*N, 6*N+16, 2*SDIM*(N-SDIM) ), else
</span><span class="comment">*</span><span class="comment"> LWORK >= max( 8*N, 6*N+16 ).
</span><span class="comment">*</span><span class="comment"> Note that 2*SDIM*(N-SDIM) <= N*N/2.
</span><span class="comment">*</span><span class="comment"> Note also that an error is only returned if
</span><span class="comment">*</span><span class="comment"> LWORK < max( 8*N, 6*N+16), but if SENSE = 'E' or 'V' or 'B'
</span><span class="comment">*</span><span class="comment"> this may not be large enough.
</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 bound on the optimal size of the WORK
</span><span class="comment">*</span><span class="comment"> array and the minimum size of the IWORK array, returns these
</span><span class="comment">*</span><span class="comment"> values as the first entries of the WORK and IWORK arrays, and
</span><span class="comment">*</span><span class="comment"> no error message related to LWORK or LIWORK is issued by
</span><span class="comment">*</span><span class="comment"> <a name="XERBLA.197"></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 (MAX(1,LIWORK))
</span><span class="comment">*</span><span class="comment"> On exit, if INFO = 0, IWORK(1) returns the minimum LIWORK.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> LIWORK (input) INTEGER
</span><span class="comment">*</span><span class="comment"> The dimension of the array IWORK.
</span><span class="comment">*</span><span class="comment"> If SENSE = 'N' or N = 0, LIWORK >= 1, otherwise
</span><span class="comment">*</span><span class="comment"> LIWORK >= N+6.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> If LIWORK = -1, then a workspace query is assumed; the
</span><span class="comment">*</span><span class="comment"> routine only calculates the bound on the optimal size of the
</span><span class="comment">*</span><span class="comment"> WORK array and the minimum size of the IWORK array, returns
</span><span class="comment">*</span><span class="comment"> these values as the first entries of the WORK and IWORK
</span><span class="comment">*</span><span class="comment"> arrays, and no error message related to LWORK or LIWORK is
</span><span class="comment">*</span><span class="comment"> issued by <a name="XERBLA.212"></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"> BWORK (workspace) LOGICAL array, dimension (N)
</span><span class="comment">*</span><span class="comment"> Not referenced if SORT = '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"> < 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. (A,B) are not in Schur
</span><span class="comment">*</span><span class="comment"> form, but ALPHAR(j), ALPHAI(j), and BETA(j) should
</span><span class="comment">*</span><span class="comment"> 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.224"></a><a href="shgeqz.f.html#SHGEQZ.1">SHGEQZ</a>
</span><span class="comment">*</span><span class="comment"> =N+2: after reordering, roundoff changed values of
</span><span class="comment">*</span><span class="comment"> some complex eigenvalues so that leading
</span><span class="comment">*</span><span class="comment"> eigenvalues in the Generalized Schur form no
</span><span class="comment">*</span><span class="comment"> longer satisfy SELCTG=.TRUE. This could also
</span><span class="comment">*</span><span class="comment"> be caused due to scaling.
</span><span class="comment">*</span><span class="comment"> =N+3: reordering failed in <a name="STGSEN.230"></a><a href="stgsen.f.html#STGSEN.1">STGSEN</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"> An approximate (asymptotic) bound on the average absolute error of
</span><span class="comment">*</span><span class="comment"> the selected eigenvalues is
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> EPS * norm((A, B)) / RCONDE( 1 ).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> An approximate (asymptotic) bound on the maximum angular error in
</span><span class="comment">*</span><span class="comment"> the computed deflating subspaces is
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> EPS * norm((A, B)) / RCONDV( 2 ).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> See LAPACK User's Guide, section 4.11 for more information.
</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 CURSL, ILASCL, ILBSCL, ILVSL, ILVSR, LASTSL,
$ LQUERY, LST2SL, WANTSB, WANTSE, WANTSN, WANTST,
$ WANTSV
INTEGER I, ICOLS, IERR, IHI, IJOB, IJOBVL, IJOBVR,
$ ILEFT, ILO, IP, IRIGHT, IROWS, ITAU, IWRK,
$ LIWMIN, LWRK, MAXWRK, MINWRK
REAL ANRM, ANRMTO, BIGNUM, BNRM, BNRMTO, EPS, PL,
$ PR, SAFMAX, SAFMIN, SMLNUM
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Local Arrays ..
</span> REAL DIF( 2 )
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. External Subroutines ..
</span> EXTERNAL <a name="SGEQRF.267"></a><a href="sgeqrf.f.html#SGEQRF.1">SGEQRF</a>, <a name="SGGBAK.267"></a><a href="sggbak.f.html#SGGBAK.1">SGGBAK</a>, <a name="SGGBAL.267"></a><a href="sggbal.f.html#SGGBAL.1">SGGBAL</a>, <a name="SGGHRD.267"></a><a href="sgghrd.f.html#SGGHRD.1">SGGHRD</a>, <a name="SHGEQZ.267"></a><a href="shgeqz.f.html#SHGEQZ.1">SHGEQZ</a>, <a name="SLABAD.267"></a><a href="slabad.f.html#SLABAD.1">SLABAD</a>,
$ <a name="SLACPY.268"></a><a href="slacpy.f.html#SLACPY.1">SLACPY</a>, <a name="SLASCL.268"></a><a href="slascl.f.html#SLASCL.1">SLASCL</a>, <a name="SLASET.268"></a><a href="slaset.f.html#SLASET.1">SLASET</a>, <a name="SORGQR.268"></a><a href="sorgqr.f.html#SORGQR.1">SORGQR</a>, <a name="SORMQR.268"></a><a href="sormqr.f.html#SORMQR.1">SORMQR</a>, <a name="STGSEN.268"></a><a href="stgsen.f.html#STGSEN.1">STGSEN</a>,
$ <a name="XERBLA.269"></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.272"></a><a href="lsame.f.html#LSAME.1">LSAME</a>
INTEGER <a name="ILAENV.273"></a><a href="hfy-index.html#ILAENV">ILAENV</a>
REAL <a name="SLAMCH.274"></a><a href="slamch.f.html#SLAMCH.1">SLAMCH</a>, <a name="SLANGE.274"></a><a href="slange.f.html#SLANGE.1">SLANGE</a>
EXTERNAL <a name="LSAME.275"></a><a href="lsame.f.html#LSAME.1">LSAME</a>, <a name="ILAENV.275"></a><a href="hfy-index.html#ILAENV">ILAENV</a>, <a name="SLAMCH.275"></a><a href="slamch.f.html#SLAMCH.1">SLAMCH</a>, <a name="SLANGE.275"></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.284"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( JOBVSL, <span class="string">'N'</span> ) ) THEN
IJOBVL = 1
ILVSL = .FALSE.
ELSE IF( <a name="LSAME.287"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( JOBVSL, <span class="string">'V'</span> ) ) THEN
IJOBVL = 2
ILVSL = .TRUE.
ELSE
IJOBVL = -1
ILVSL = .FALSE.
END IF
<span class="comment">*</span><span class="comment">
</span> IF( <a name="LSAME.295"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( JOBVSR, <span class="string">'N'</span> ) ) THEN
IJOBVR = 1
ILVSR = .FALSE.
ELSE IF( <a name="LSAME.298"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( JOBVSR, <span class="string">'V'</span> ) ) THEN
IJOBVR = 2
ILVSR = .TRUE.
ELSE
IJOBVR = -1
ILVSR = .FALSE.
END IF
<span class="comment">*</span><span class="comment">
</span> WANTST = <a name="LSAME.306"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( SORT, <span class="string">'S'</span> )
WANTSN = <a name="LSAME.307"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( SENSE, <span class="string">'N'</span> )
WANTSE = <a name="LSAME.308"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( SENSE, <span class="string">'E'</span> )
WANTSV = <a name="LSAME.309"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( SENSE, <span class="string">'V'</span> )
WANTSB = <a name="LSAME.310"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( SENSE, <span class="string">'B'</span> )
LQUERY = ( LWORK.EQ.-1 .OR. LIWORK.EQ.-1 )
IF( WANTSN ) THEN
IJOB = 0
ELSE IF( WANTSE ) THEN
IJOB = 1
ELSE IF( WANTSV ) THEN
IJOB = 2
ELSE IF( WANTSB ) THEN
IJOB = 4
END IF
<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
IF( IJOBVL.LE.0 ) THEN
INFO = -1
ELSE IF( IJOBVR.LE.0 ) THEN
INFO = -2
ELSE IF( ( .NOT.WANTST ) .AND. ( .NOT.<a name="LSAME.329"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( SORT, <span class="string">'N'</span> ) ) ) THEN
INFO = -3
ELSE IF( .NOT.( WANTSN .OR. WANTSE .OR. WANTSV .OR. WANTSB ) .OR.
$ ( .NOT.WANTST .AND. .NOT.WANTSN ) ) THEN
INFO = -5
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?