zgees.f.html
来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 349 行 · 第 1/2 页
HTML
349 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>zgees.f</title>
<meta name="generator" content="emacs 21.3.1; htmlfontify 0.20">
<style type="text/css"><!--
body { background: rgb(255, 255, 255); color: rgb(0, 0, 0); font-style: normal; font-weight: 500; font-stretch: normal; font-family: adobe-courier; font-size: 11pt; text-decoration: none; }
span.default { background: rgb(255, 255, 255); color: rgb(0, 0, 0); font-style: normal; font-weight: 500; font-stretch: normal; font-family: adobe-courier; font-size: 11pt; text-decoration: none; }
span.default a { background: rgb(255, 255, 255); color: rgb(0, 0, 0); font-style: normal; font-weight: 500; font-stretch: normal; font-family: adobe-courier; font-size: 11pt; text-decoration: underline; }
span.string { color: rgb(188, 143, 143); background: rgb(255, 255, 255); font-style: normal; font-weight: 500; font-stretch: normal; font-family: adobe-courier; font-size: 11pt; text-decoration: none; }
span.string a { color: rgb(188, 143, 143); background: rgb(255, 255, 255); font-style: normal; font-weight: 500; font-stretch: normal; font-family: adobe-courier; font-size: 11pt; text-decoration: underline; }
span.comment { color: rgb(178, 34, 34); background: rgb(255, 255, 255); font-style: normal; font-weight: 500; font-stretch: normal; font-family: adobe-courier; font-size: 11pt; text-decoration: none; }
span.comment a { color: rgb(178, 34, 34); background: rgb(255, 255, 255); font-style: normal; font-weight: 500; font-stretch: normal; font-family: adobe-courier; font-size: 11pt; text-decoration: underline; }
--></style>
</head>
<body>
<pre>
SUBROUTINE <a name="ZGEES.1"></a><a href="zgees.f.html#ZGEES.1">ZGEES</a>( JOBVS, SORT, SELECT, N, A, LDA, SDIM, W, VS,
$ LDVS, WORK, LWORK, RWORK, BWORK, INFO )
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> -- LAPACK driver routine (version 3.1) --
</span><span class="comment">*</span><span class="comment"> Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
</span><span class="comment">*</span><span class="comment"> November 2006
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> .. Scalar Arguments ..
</span> CHARACTER JOBVS, SORT
INTEGER INFO, LDA, LDVS, LWORK, N, SDIM
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Array Arguments ..
</span> LOGICAL BWORK( * )
DOUBLE PRECISION RWORK( * )
COMPLEX*16 A( LDA, * ), VS( LDVS, * ), W( * ), WORK( * )
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Function Arguments ..
</span> LOGICAL SELECT
EXTERNAL SELECT
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Purpose
</span><span class="comment">*</span><span class="comment"> =======
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> <a name="ZGEES.25"></a><a href="zgees.f.html#ZGEES.1">ZGEES</a> computes for an N-by-N complex nonsymmetric matrix A, the
</span><span class="comment">*</span><span class="comment"> eigenvalues, the Schur form T, and, optionally, the matrix of Schur
</span><span class="comment">*</span><span class="comment"> vectors Z. This gives the Schur factorization A = Z*T*(Z**H).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Optionally, it also orders the eigenvalues on the diagonal of the
</span><span class="comment">*</span><span class="comment"> Schur form so that selected eigenvalues are at the top left.
</span><span class="comment">*</span><span class="comment"> The leading columns of Z then form an orthonormal basis for the
</span><span class="comment">*</span><span class="comment"> invariant subspace corresponding to the selected eigenvalues.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> A complex matrix is in Schur form if it is upper triangular.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Arguments
</span><span class="comment">*</span><span class="comment"> =========
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> JOBVS (input) CHARACTER*1
</span><span class="comment">*</span><span class="comment"> = 'N': Schur vectors are not computed;
</span><span class="comment">*</span><span class="comment"> = 'V': Schur vectors are computed.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> SORT (input) CHARACTER*1
</span><span class="comment">*</span><span class="comment"> Specifies whether or not to order the eigenvalues on the
</span><span class="comment">*</span><span class="comment"> diagonal of the Schur form.
</span><span class="comment">*</span><span class="comment"> = 'N': Eigenvalues are not ordered:
</span><span class="comment">*</span><span class="comment"> = 'S': Eigenvalues are ordered (see SELECT).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> SELECT (external procedure) LOGICAL FUNCTION of one COMPLEX*16 argument
</span><span class="comment">*</span><span class="comment"> SELECT must be declared EXTERNAL in the calling subroutine.
</span><span class="comment">*</span><span class="comment"> If SORT = 'S', SELECT is used to select eigenvalues to order
</span><span class="comment">*</span><span class="comment"> to the top left of the Schur form.
</span><span class="comment">*</span><span class="comment"> IF SORT = 'N', SELECT is not referenced.
</span><span class="comment">*</span><span class="comment"> The eigenvalue W(j) is selected if SELECT(W(j)) is true.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> N (input) INTEGER
</span><span class="comment">*</span><span class="comment"> The order of the matrix A. N >= 0.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> A (input/output) COMPLEX*16 array, dimension (LDA,N)
</span><span class="comment">*</span><span class="comment"> On entry, the N-by-N matrix A.
</span><span class="comment">*</span><span class="comment"> On exit, A has been overwritten by its Schur form T.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> LDA (input) INTEGER
</span><span class="comment">*</span><span class="comment"> The leading dimension of the array A. LDA >= max(1,N).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> SDIM (output) INTEGER
</span><span class="comment">*</span><span class="comment"> If SORT = 'N', SDIM = 0.
</span><span class="comment">*</span><span class="comment"> If SORT = 'S', SDIM = number of eigenvalues for which
</span><span class="comment">*</span><span class="comment"> SELECT is true.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> W (output) COMPLEX*16 array, dimension (N)
</span><span class="comment">*</span><span class="comment"> W contains the computed eigenvalues, in the same order that
</span><span class="comment">*</span><span class="comment"> they appear on the diagonal of the output Schur form T.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> VS (output) COMPLEX*16 array, dimension (LDVS,N)
</span><span class="comment">*</span><span class="comment"> If JOBVS = 'V', VS contains the unitary matrix Z of Schur
</span><span class="comment">*</span><span class="comment"> vectors.
</span><span class="comment">*</span><span class="comment"> If JOBVS = 'N', VS is not referenced.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> LDVS (input) INTEGER
</span><span class="comment">*</span><span class="comment"> The leading dimension of the array VS. LDVS >= 1; if
</span><span class="comment">*</span><span class="comment"> JOBVS = 'V', LDVS >= N.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> WORK (workspace/output) COMPLEX*16 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"> 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.94"></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) DOUBLE PRECISION array, dimension (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"> > 0: if INFO = i, and i is
</span><span class="comment">*</span><span class="comment"> <= N: the QR algorithm failed to compute all the
</span><span class="comment">*</span><span class="comment"> eigenvalues; elements 1:ILO-1 and i+1:N of W
</span><span class="comment">*</span><span class="comment"> contain those eigenvalues which have converged;
</span><span class="comment">*</span><span class="comment"> if JOBVS = 'V', VS contains the matrix which
</span><span class="comment">*</span><span class="comment"> reduces A to its partially converged Schur form.
</span><span class="comment">*</span><span class="comment"> = N+1: the eigenvalues could not be reordered because
</span><span class="comment">*</span><span class="comment"> some eigenvalues were too close to separate (the
</span><span class="comment">*</span><span class="comment"> problem is very ill-conditioned);
</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 Schur form no longer satisfy
</span><span class="comment">*</span><span class="comment"> SELECT = .TRUE.. This could also be caused by
</span><span class="comment">*</span><span class="comment"> underflow due to scaling.
</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, WANTST, WANTVS
INTEGER HSWORK, I, IBAL, ICOND, IERR, IEVAL, IHI, ILO,
$ ITAU, IWRK, MAXWRK, MINWRK
DOUBLE PRECISION ANRM, BIGNUM, CSCALE, EPS, S, SEP, SMLNUM
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Local Arrays ..
</span> 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="DLABAD.135"></a><a href="dlabad.f.html#DLABAD.1">DLABAD</a>, <a name="XERBLA.135"></a><a href="xerbla.f.html#XERBLA.1">XERBLA</a>, ZCOPY, <a name="ZGEBAK.135"></a><a href="zgebak.f.html#ZGEBAK.1">ZGEBAK</a>, <a name="ZGEBAL.135"></a><a href="zgebal.f.html#ZGEBAL.1">ZGEBAL</a>, <a name="ZGEHRD.135"></a><a href="zgehrd.f.html#ZGEHRD.1">ZGEHRD</a>,
$ <a name="ZHSEQR.136"></a><a href="zhseqr.f.html#ZHSEQR.1">ZHSEQR</a>, <a name="ZLACPY.136"></a><a href="zlacpy.f.html#ZLACPY.1">ZLACPY</a>, <a name="ZLASCL.136"></a><a href="zlascl.f.html#ZLASCL.1">ZLASCL</a>, <a name="ZTRSEN.136"></a><a href="ztrsen.f.html#ZTRSEN.1">ZTRSEN</a>, <a name="ZUNGHR.136"></a><a href="zunghr.f.html#ZUNGHR.1">ZUNGHR</a>
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. External Functions ..
</span> LOGICAL <a name="LSAME.139"></a><a href="lsame.f.html#LSAME.1">LSAME</a>
INTEGER <a name="ILAENV.140"></a><a href="hfy-index.html#ILAENV">ILAENV</a>
DOUBLE PRECISION <a name="DLAMCH.141"></a><a href="dlamch.f.html#DLAMCH.1">DLAMCH</a>, <a name="ZLANGE.141"></a><a href="zlange.f.html#ZLANGE.1">ZLANGE</a>
EXTERNAL <a name="LSAME.142"></a><a href="lsame.f.html#LSAME.1">LSAME</a>, <a name="ILAENV.142"></a><a href="hfy-index.html#ILAENV">ILAENV</a>, <a name="DLAMCH.142"></a><a href="dlamch.f.html#DLAMCH.1">DLAMCH</a>, <a name="ZLANGE.142"></a><a href="zlange.f.html#ZLANGE.1">ZLANGE</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"> Test the input arguments
</span><span class="comment">*</span><span class="comment">
</span> INFO = 0
LQUERY = ( LWORK.EQ.-1 )
WANTVS = <a name="LSAME.153"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( JOBVS, <span class="string">'V'</span> )
WANTST = <a name="LSAME.154"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( SORT, <span class="string">'S'</span> )
IF( ( .NOT.WANTVS ) .AND. ( .NOT.<a name="LSAME.155"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( JOBVS, <span class="string">'N'</span> ) ) ) THEN
INFO = -1
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?