cgges.f.html
来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 502 行 · 第 1/3 页
HTML
502 行
</span><span class="comment">*</span><span class="comment"> message related to LWORK is issued by <a name="XERBLA.150"></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"> RWORK (workspace) REAL array, dimension (8*N)
</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 ALPHA(j) and BETA(j) should be correct for
</span><span class="comment">*</span><span class="comment"> j=INFO+1,...,N.
</span><span class="comment">*</span><span class="comment"> > N: =N+1: other than QZ iteration failed in <a name="CHGEQZ.164"></a><a href="chgeqz.f.html#CHGEQZ.1">CHGEQZ</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 falied in <a name="CTGSEN.170"></a><a href="ctgsen.f.html#CTGSEN.1">CTGSEN</a>.
</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.0E0, ONE = 1.0E0 )
COMPLEX CZERO, CONE
PARAMETER ( CZERO = ( 0.0E0, 0.0E0 ),
$ CONE = ( 1.0E0, 0.0E0 ) )
<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, WANTST
INTEGER I, ICOLS, IERR, IHI, IJOBVL, IJOBVR, ILEFT,
$ ILO, IRIGHT, IROWS, IRWRK, ITAU, IWRK, LWKMIN,
$ LWKOPT
REAL ANRM, ANRMTO, BIGNUM, BNRM, BNRMTO, EPS, PVSL,
$ PVSR, SMLNUM
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Local Arrays ..
</span> INTEGER IDUM( 1 )
REAL DIF( 2 )
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. External Subroutines ..
</span> EXTERNAL <a name="CGEQRF.195"></a><a href="cgeqrf.f.html#CGEQRF.1">CGEQRF</a>, <a name="CGGBAK.195"></a><a href="cggbak.f.html#CGGBAK.1">CGGBAK</a>, <a name="CGGBAL.195"></a><a href="cggbal.f.html#CGGBAL.1">CGGBAL</a>, <a name="CGGHRD.195"></a><a href="cgghrd.f.html#CGGHRD.1">CGGHRD</a>, <a name="CHGEQZ.195"></a><a href="chgeqz.f.html#CHGEQZ.1">CHGEQZ</a>, <a name="CLACPY.195"></a><a href="clacpy.f.html#CLACPY.1">CLACPY</a>,
$ <a name="CLASCL.196"></a><a href="clascl.f.html#CLASCL.1">CLASCL</a>, <a name="CLASET.196"></a><a href="claset.f.html#CLASET.1">CLASET</a>, <a name="CTGSEN.196"></a><a href="ctgsen.f.html#CTGSEN.1">CTGSEN</a>, <a name="CUNGQR.196"></a><a href="cungqr.f.html#CUNGQR.1">CUNGQR</a>, <a name="CUNMQR.196"></a><a href="cunmqr.f.html#CUNMQR.1">CUNMQR</a>, <a name="SLABAD.196"></a><a href="slabad.f.html#SLABAD.1">SLABAD</a>,
$ <a name="XERBLA.197"></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.200"></a><a href="lsame.f.html#LSAME.1">LSAME</a>
INTEGER <a name="ILAENV.201"></a><a href="hfy-index.html#ILAENV">ILAENV</a>
REAL <a name="CLANGE.202"></a><a href="clange.f.html#CLANGE.1">CLANGE</a>, <a name="SLAMCH.202"></a><a href="slamch.f.html#SLAMCH.1">SLAMCH</a>
EXTERNAL <a name="LSAME.203"></a><a href="lsame.f.html#LSAME.1">LSAME</a>, <a name="ILAENV.203"></a><a href="hfy-index.html#ILAENV">ILAENV</a>, <a name="CLANGE.203"></a><a href="clange.f.html#CLANGE.1">CLANGE</a>, <a name="SLAMCH.203"></a><a href="slamch.f.html#SLAMCH.1">SLAMCH</a>
<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"> Decode the input arguments
</span><span class="comment">*</span><span class="comment">
</span> IF( <a name="LSAME.212"></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.215"></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.223"></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.226"></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.234"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( SORT, <span class="string">'S'</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( IJOBVL.LE.0 ) THEN
INFO = -1
ELSE IF( IJOBVR.LE.0 ) THEN
INFO = -2
ELSE IF( ( .NOT.WANTST ) .AND. ( .NOT.<a name="LSAME.244"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( SORT, <span class="string">'N'</span> ) ) ) THEN
INFO = -3
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( LDVSL.LT.1 .OR. ( ILVSL .AND. LDVSL.LT.N ) ) THEN
INFO = -14
ELSE IF( LDVSR.LT.1 .OR. ( ILVSR .AND. LDVSR.LT.N ) ) THEN
INFO = -16
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 "Workspace:" 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.263"></a><a href="hfy-index.html#ILAENV">ILAENV</a>.)
</span><span class="comment">*</span><span class="comment">
</span> IF( INFO.EQ.0 ) THEN
LWKMIN = MAX( 1, 2*N )
LWKOPT = MAX( 1, N + N*<a name="ILAENV.267"></a><a href="hfy-index.html#ILAENV">ILAENV</a>( 1, <span class="string">'<a name="CGEQRF.267"></a><a href="cgeqrf.f.html#CGEQRF.1">CGEQRF</a>'</span>, <span class="string">' '</span>, N, 1, N, 0 ) )
LWKOPT = MAX( LWKOPT, N +
$ N*<a name="ILAENV.269"></a><a href="hfy-index.html#ILAENV">ILAENV</a>( 1, <span class="string">'<a name="CUNMQR.269"></a><a href="cunmqr.f.html#CUNMQR.1">CUNMQR</a>'</span>, <span class="string">' '</span>, N, 1, N, -1 ) )
IF( ILVSL ) THEN
LWKOPT = MAX( LWKOPT, N +
$ N*<a name="ILAENV.272"></a><a href="hfy-index.html#ILAENV">ILAENV</a>( 1, <span class="string">'<a name="CUNGQR.272"></a><a href="cungqr.f.html#CUNGQR.1">CUNGQR</a>'</span>, <span class="string">' '</span>, N, 1, N, -1 ) )
END IF
WORK( 1 ) = LWKOPT
<span class="comment">*</span><span class="comment">
</span> IF( LWORK.LT.LWKMIN .AND. .NOT.LQUERY )
$ INFO = -18
END IF
<span class="comment">*</span><span class="comment">
</span> IF( INFO.NE.0 ) THEN
CALL <a name="XERBLA.281"></a><a href="xerbla.f.html#XERBLA.1">XERBLA</a>( <span class="string">'<a name="CGGES.281"></a><a href="cgges.f.html#CGGES.1">CGGES</a> '</span>, -INFO )
RETURN
ELSE IF( LQUERY ) THEN
RETURN
END IF
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Quick return if possible
</span><span class="comment">*</span><span class="comment">
</span> IF( N.EQ.0 ) THEN
SDIM = 0
RETURN
END IF
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Get machine constants
</span><span class="comment">*</span><span class="comment">
</span> EPS = <a name="SLAMCH.296"></a><a href="slamch.f.html#SLAMCH.1">SLAMCH</a>( <span class="string">'P'</span> )
SMLNUM = <a name="SLAMCH.297"></a><a href="slamch.f.html#SLAMCH.1">SLAMCH</a>( <span class="string">'S'</span> )
BIGNUM = ONE / SMLNUM
CALL <a name="SLABAD.299"></a><a href="slabad.f.html#SLABAD.1">SLABAD</a>( SMLNUM, BIGNUM )
SMLNUM = SQRT( SMLNUM ) / EPS
BIGNUM = ONE / SMLNUM
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Scale A if max element outside range [SMLNUM,BIGNUM]
</span><span class="comment">*</span><span class="comment">
</span> ANRM = <a name="CLANGE.305"></a><a href="clange.f.html#CLANGE.1">CLANGE</a>( <span class="string">'M'</span>, N, N, A, LDA, RWORK )
ILASCL = .FALSE.
IF( ANRM.GT.ZERO .AND. ANRM.LT.SMLNUM ) THEN
ANRMTO = SMLNUM
ILASCL = .TRUE.
ELSE IF( ANRM.GT.BIGNUM ) THEN
ANRMTO = BIGNUM
ILASCL = .TRUE.
END IF
<span class="comment">*</span><span class="comment">
</span> IF( ILASCL )
$ CALL <a name="CLASCL.316"></a><a href="clascl.f.html#CLASCL.1">CLASCL</a>( <span class="string">'G'</span>, 0, 0, ANRM, ANRMTO, N, N, A, LDA, IERR )
<span class="comment">*</span><span class="comment">
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?