ztgevc.f.html
来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 658 行 · 第 1/3 页
HTML
658 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>ztgevc.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="ZTGEVC.1"></a><a href="ztgevc.f.html#ZTGEVC.1">ZTGEVC</a>( SIDE, HOWMNY, SELECT, N, S, LDS, P, LDP, VL,
$ LDVL, VR, LDVR, MM, M, WORK, RWORK, INFO )
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> -- LAPACK 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 HOWMNY, SIDE
INTEGER INFO, LDP, LDS, LDVL, LDVR, M, MM, N
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Array Arguments ..
</span> LOGICAL SELECT( * )
DOUBLE PRECISION RWORK( * )
COMPLEX*16 P( LDP, * ), S( LDS, * ), VL( LDVL, * ),
$ VR( LDVR, * ), WORK( * )
<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"> 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="ZTGEVC.23"></a><a href="ztgevc.f.html#ZTGEVC.1">ZTGEVC</a> computes some or all of the right and/or left eigenvectors of
</span><span class="comment">*</span><span class="comment"> a pair of complex matrices (S,P), where S and P are upper triangular.
</span><span class="comment">*</span><span class="comment"> Matrix pairs of this type are produced by the generalized Schur
</span><span class="comment">*</span><span class="comment"> factorization of a complex matrix pair (A,B):
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> A = Q*S*Z**H, B = Q*P*Z**H
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> as computed by <a name="ZGGHRD.30"></a><a href="zgghrd.f.html#ZGGHRD.1">ZGGHRD</a> + <a name="ZHGEQZ.30"></a><a href="zhgeqz.f.html#ZHGEQZ.1">ZHGEQZ</a>.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> The right eigenvector x and the left eigenvector y of (S,P)
</span><span class="comment">*</span><span class="comment"> corresponding to an eigenvalue w are defined by:
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> S*x = w*P*x, (y**H)*S = w*(y**H)*P,
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> where y**H denotes the conjugate tranpose of y.
</span><span class="comment">*</span><span class="comment"> The eigenvalues are not input to this routine, but are computed
</span><span class="comment">*</span><span class="comment"> directly from the diagonal elements of S and P.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> This routine returns the matrices X and/or Y of right and left
</span><span class="comment">*</span><span class="comment"> eigenvectors of (S,P), or the products Z*X and/or Q*Y,
</span><span class="comment">*</span><span class="comment"> where Z and Q are input matrices.
</span><span class="comment">*</span><span class="comment"> If Q and Z are the unitary factors from the generalized Schur
</span><span class="comment">*</span><span class="comment"> factorization of a matrix pair (A,B), then Z*X and Q*Y
</span><span class="comment">*</span><span class="comment"> are the matrices of right and left eigenvectors of (A,B).
</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"> SIDE (input) CHARACTER*1
</span><span class="comment">*</span><span class="comment"> = 'R': compute right eigenvectors only;
</span><span class="comment">*</span><span class="comment"> = 'L': compute left eigenvectors only;
</span><span class="comment">*</span><span class="comment"> = 'B': compute both right and left eigenvectors.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> HOWMNY (input) CHARACTER*1
</span><span class="comment">*</span><span class="comment"> = 'A': compute all right and/or left eigenvectors;
</span><span class="comment">*</span><span class="comment"> = 'B': compute all right and/or left eigenvectors,
</span><span class="comment">*</span><span class="comment"> backtransformed by the matrices in VR and/or VL;
</span><span class="comment">*</span><span class="comment"> = 'S': compute selected right and/or left eigenvectors,
</span><span class="comment">*</span><span class="comment"> specified by the logical array SELECT.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> SELECT (input) LOGICAL array, dimension (N)
</span><span class="comment">*</span><span class="comment"> If HOWMNY='S', SELECT specifies the eigenvectors to be
</span><span class="comment">*</span><span class="comment"> computed. The eigenvector corresponding to the j-th
</span><span class="comment">*</span><span class="comment"> eigenvalue is computed if SELECT(j) = .TRUE..
</span><span class="comment">*</span><span class="comment"> Not referenced if HOWMNY = 'A' or 'B'.
</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 matrices S and P. N >= 0.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> S (input) COMPLEX*16 array, dimension (LDS,N)
</span><span class="comment">*</span><span class="comment"> The upper triangular matrix S from a generalized Schur
</span><span class="comment">*</span><span class="comment"> factorization, as computed by <a name="ZHGEQZ.74"></a><a href="zhgeqz.f.html#ZHGEQZ.1">ZHGEQZ</a>.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> LDS (input) INTEGER
</span><span class="comment">*</span><span class="comment"> The leading dimension of array S. LDS >= max(1,N).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> P (input) COMPLEX*16 array, dimension (LDP,N)
</span><span class="comment">*</span><span class="comment"> The upper triangular matrix P from a generalized Schur
</span><span class="comment">*</span><span class="comment"> factorization, as computed by <a name="ZHGEQZ.81"></a><a href="zhgeqz.f.html#ZHGEQZ.1">ZHGEQZ</a>. P must have real
</span><span class="comment">*</span><span class="comment"> diagonal elements.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> LDP (input) INTEGER
</span><span class="comment">*</span><span class="comment"> The leading dimension of array P. LDP >= max(1,N).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> VL (input/output) COMPLEX*16 array, dimension (LDVL,MM)
</span><span class="comment">*</span><span class="comment"> On entry, if SIDE = 'L' or 'B' and HOWMNY = 'B', VL must
</span><span class="comment">*</span><span class="comment"> contain an N-by-N matrix Q (usually the unitary matrix Q
</span><span class="comment">*</span><span class="comment"> of left Schur vectors returned by <a name="ZHGEQZ.90"></a><a href="zhgeqz.f.html#ZHGEQZ.1">ZHGEQZ</a>).
</span><span class="comment">*</span><span class="comment"> On exit, if SIDE = 'L' or 'B', VL contains:
</span><span class="comment">*</span><span class="comment"> if HOWMNY = 'A', the matrix Y of left eigenvectors of (S,P);
</span><span class="comment">*</span><span class="comment"> if HOWMNY = 'B', the matrix Q*Y;
</span><span class="comment">*</span><span class="comment"> if HOWMNY = 'S', the left eigenvectors of (S,P) specified by
</span><span class="comment">*</span><span class="comment"> SELECT, stored consecutively in the columns of
</span><span class="comment">*</span><span class="comment"> VL, in the same order as their eigenvalues.
</span><span class="comment">*</span><span class="comment"> Not referenced if SIDE = 'R'.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> LDVL (input) INTEGER
</span><span class="comment">*</span><span class="comment"> The leading dimension of array VL. LDVL >= 1, and if
</span><span class="comment">*</span><span class="comment"> SIDE = 'L' or 'l' or 'B' or 'b', LDVL >= N.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> VR (input/output) COMPLEX*16 array, dimension (LDVR,MM)
</span><span class="comment">*</span><span class="comment"> On entry, if SIDE = 'R' or 'B' and HOWMNY = 'B', VR must
</span><span class="comment">*</span><span class="comment"> contain an N-by-N matrix Q (usually the unitary matrix Z
</span><span class="comment">*</span><span class="comment"> of right Schur vectors returned by <a name="ZHGEQZ.106"></a><a href="zhgeqz.f.html#ZHGEQZ.1">ZHGEQZ</a>).
</span><span class="comment">*</span><span class="comment"> On exit, if SIDE = 'R' or 'B', VR contains:
</span><span class="comment">*</span><span class="comment"> if HOWMNY = 'A', the matrix X of right eigenvectors of (S,P);
</span><span class="comment">*</span><span class="comment"> if HOWMNY = 'B', the matrix Z*X;
</span><span class="comment">*</span><span class="comment"> if HOWMNY = 'S', the right eigenvectors of (S,P) specified by
</span><span class="comment">*</span><span class="comment"> SELECT, stored consecutively in the columns of
</span><span class="comment">*</span><span class="comment"> VR, in the same order as their eigenvalues.
</span><span class="comment">*</span><span class="comment"> Not referenced if SIDE = 'L'.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> LDVR (input) INTEGER
</span><span class="comment">*</span><span class="comment"> The leading dimension of the array VR. LDVR >= 1, and if
</span><span class="comment">*</span><span class="comment"> SIDE = 'R' or 'B', LDVR >= N.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> MM (input) INTEGER
</span><span class="comment">*</span><span class="comment"> The number of columns in the arrays VL and/or VR. MM >= M.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> M (output) INTEGER
</span><span class="comment">*</span><span class="comment"> The number of columns in the arrays VL and/or VR actually
</span><span class="comment">*</span><span class="comment"> used to store the eigenvectors. If HOWMNY = 'A' or 'B', M
</span><span class="comment">*</span><span class="comment"> is set to N. Each selected eigenvector occupies one column.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> WORK (workspace) COMPLEX*16 array, dimension (2*N)
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> RWORK (workspace) DOUBLE PRECISION array, dimension (2*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">
</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 )
COMPLEX*16 CZERO, CONE
PARAMETER ( CZERO = ( 0.0D+0, 0.0D+0 ),
$ CONE = ( 1.0D+0, 0.0D+0 ) )
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Local Scalars ..
</span> LOGICAL COMPL, COMPR, ILALL, ILBACK, ILBBAD, ILCOMP,
$ LSA, LSB
INTEGER I, IBEG, IEIG, IEND, IHWMNY, IM, ISIDE, ISRC,
$ J, JE, JR
DOUBLE PRECISION ACOEFA, ACOEFF, ANORM, ASCALE, BCOEFA, BIG,
$ BIGNUM, BNORM, BSCALE, DMIN, SAFMIN, SBETA,
$ SCALE, SMALL, TEMP, ULP, XMAX
COMPLEX*16 BCOEFF, CA, CB, D, SALPHA, SUM, SUMA, SUMB, X
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. External Functions ..
</span> LOGICAL <a name="LSAME.155"></a><a href="lsame.f.html#LSAME.1">LSAME</a>
DOUBLE PRECISION <a name="DLAMCH.156"></a><a href="dlamch.f.html#DLAMCH.1">DLAMCH</a>
COMPLEX*16 <a name="ZLADIV.157"></a><a href="zladiv.f.html#ZLADIV.1">ZLADIV</a>
EXTERNAL <a name="LSAME.158"></a><a href="lsame.f.html#LSAME.1">LSAME</a>, <a name="DLAMCH.158"></a><a href="dlamch.f.html#DLAMCH.1">DLAMCH</a>, <a name="ZLADIV.158"></a><a href="zladiv.f.html#ZLADIV.1">ZLADIV</a>
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. External Subroutines ..
</span> EXTERNAL <a name="DLABAD.161"></a><a href="dlabad.f.html#DLABAD.1">DLABAD</a>, <a name="XERBLA.161"></a><a href="xerbla.f.html#XERBLA.1">XERBLA</a>, ZGEMV
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Intrinsic Functions ..
</span> INTRINSIC ABS, DBLE, DCMPLX, DCONJG, DIMAG, MAX, MIN
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Statement Functions ..
</span> DOUBLE PRECISION ABS1
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Statement Function definitions ..
</span> ABS1( X ) = ABS( DBLE( X ) ) + ABS( DIMAG( X ) )
<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 and Test the input parameters
</span><span class="comment">*</span><span class="comment">
</span> IF( <a name="LSAME.176"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( HOWMNY, <span class="string">'A'</span> ) ) THEN
IHWMNY = 1
ILALL = .TRUE.
ILBACK = .FALSE.
ELSE IF( <a name="LSAME.180"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( HOWMNY, <span class="string">'S'</span> ) ) THEN
IHWMNY = 2
ILALL = .FALSE.
ILBACK = .FALSE.
ELSE IF( <a name="LSAME.184"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( HOWMNY, <span class="string">'B'</span> ) ) THEN
IHWMNY = 3
ILALL = .TRUE.
ILBACK = .TRUE.
ELSE
IHWMNY = -1
END IF
<span class="comment">*</span><span class="comment">
</span> IF( <a name="LSAME.192"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( SIDE, <span class="string">'R'</span> ) ) THEN
ISIDE = 1
COMPL = .FALSE.
COMPR = .TRUE.
ELSE IF( <a name="LSAME.196"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( SIDE, <span class="string">'L'</span> ) ) THEN
ISIDE = 2
COMPL = .TRUE.
COMPR = .FALSE.
ELSE IF( <a name="LSAME.200"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( SIDE, <span class="string">'B'</span> ) ) THEN
ISIDE = 3
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?