strevc.f.html
来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 1,006 行 · 第 1/5 页
HTML
1,006 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>strevc.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="STREVC.1"></a><a href="strevc.f.html#STREVC.1">STREVC</a>( SIDE, HOWMNY, SELECT, N, T, LDT, VL, LDVL, VR,
$ LDVR, MM, M, WORK, 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, LDT, 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( * )
REAL T( LDT, * ), 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"> 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="STREVC.21"></a><a href="strevc.f.html#STREVC.1">STREVC</a> computes some or all of the right and/or left eigenvectors of
</span><span class="comment">*</span><span class="comment"> a real upper quasi-triangular matrix T.
</span><span class="comment">*</span><span class="comment"> Matrices of this type are produced by the Schur factorization of
</span><span class="comment">*</span><span class="comment"> a real general matrix: A = Q*T*Q**T, as computed by <a name="SHSEQR.24"></a><a href="shseqr.f.html#SHSEQR.1">SHSEQR</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 T corresponding
</span><span class="comment">*</span><span class="comment"> to an eigenvalue w are defined by:
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> T*x = w*x, (y**H)*T = w*(y**H)
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> where y**H denotes the conjugate transpose of y.
</span><span class="comment">*</span><span class="comment"> The eigenvalues are not input to this routine, but are read directly
</span><span class="comment">*</span><span class="comment"> from the diagonal blocks of T.
</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 T, or the products Q*X and/or Q*Y, where Q is an
</span><span class="comment">*</span><span class="comment"> input matrix. If Q is the orthogonal factor that reduces a matrix
</span><span class="comment">*</span><span class="comment"> A to Schur form T, then Q*X and Q*Y are the matrices of right and
</span><span class="comment">*</span><span class="comment"> left eigenvectors of A.
</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"> as indicated by the logical array SELECT.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> SELECT (input/output) 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.
</span><span class="comment">*</span><span class="comment"> If w(j) is a real eigenvalue, the corresponding real
</span><span class="comment">*</span><span class="comment"> eigenvector is computed if SELECT(j) is .TRUE..
</span><span class="comment">*</span><span class="comment"> If w(j) and w(j+1) are the real and imaginary parts of a
</span><span class="comment">*</span><span class="comment"> complex eigenvalue, the corresponding complex eigenvector is
</span><span class="comment">*</span><span class="comment"> computed if either SELECT(j) or SELECT(j+1) is .TRUE., and
</span><span class="comment">*</span><span class="comment"> on exit SELECT(j) is set to .TRUE. and SELECT(j+1) is set to
</span><span class="comment">*</span><span class="comment"> .FALSE..
</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 matrix T. N >= 0.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> T (input) REAL array, dimension (LDT,N)
</span><span class="comment">*</span><span class="comment"> The upper quasi-triangular matrix T in Schur canonical form.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> LDT (input) INTEGER
</span><span class="comment">*</span><span class="comment"> The leading dimension of the array T. LDT >= max(1,N).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> VL (input/output) REAL 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 orthogonal matrix Q
</span><span class="comment">*</span><span class="comment"> of Schur vectors returned by <a name="SHSEQR.80"></a><a href="shseqr.f.html#SHSEQR.1">SHSEQR</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 T;
</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 T specified by
</span><span class="comment">*</span><span class="comment"> SELECT, stored consecutively in the columns
</span><span class="comment">*</span><span class="comment"> of VL, in the same order as their
</span><span class="comment">*</span><span class="comment"> eigenvalues.
</span><span class="comment">*</span><span class="comment"> A complex eigenvector corresponding to a complex eigenvalue
</span><span class="comment">*</span><span class="comment"> is stored in two consecutive columns, the first holding the
</span><span class="comment">*</span><span class="comment"> real part, and the second the imaginary part.
</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 the array VL. LDVL >= 1, and if
</span><span class="comment">*</span><span class="comment"> SIDE = 'L' or 'B', LDVL >= N.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> VR (input/output) REAL 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 orthogonal matrix Q
</span><span class="comment">*</span><span class="comment"> of Schur vectors returned by <a name="SHSEQR.100"></a><a href="shseqr.f.html#SHSEQR.1">SHSEQR</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 T;
</span><span class="comment">*</span><span class="comment"> if HOWMNY = 'B', the matrix Q*X;
</span><span class="comment">*</span><span class="comment"> if HOWMNY = 'S', the right eigenvectors of T specified by
</span><span class="comment">*</span><span class="comment"> SELECT, stored consecutively in the columns
</span><span class="comment">*</span><span class="comment"> of VR, in the same order as their
</span><span class="comment">*</span><span class="comment"> eigenvalues.
</span><span class="comment">*</span><span class="comment"> A complex eigenvector corresponding to a complex eigenvalue
</span><span class="comment">*</span><span class="comment"> is stored in two consecutive columns, the first holding the
</span><span class="comment">*</span><span class="comment"> real part and the second the imaginary part.
</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.
</span><span class="comment">*</span><span class="comment"> If HOWMNY = 'A' or 'B', M is set to N.
</span><span class="comment">*</span><span class="comment"> Each selected real eigenvector occupies one column and each
</span><span class="comment">*</span><span class="comment"> selected complex eigenvector occupies two columns.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> WORK (workspace) REAL array, dimension (3*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"> 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"> The algorithm used in this program is basically backward (forward)
</span><span class="comment">*</span><span class="comment"> substitution, with scaling to make the the code robust against
</span><span class="comment">*</span><span class="comment"> possible overflow.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Each eigenvector is normalized so that the element of largest
</span><span class="comment">*</span><span class="comment"> magnitude has magnitude 1; here the magnitude of a complex number
</span><span class="comment">*</span><span class="comment"> (x,y) is taken to be |x| + |y|.
</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 ALLV, BOTHV, LEFTV, OVER, PAIR, RIGHTV, SOMEV
INTEGER I, IERR, II, IP, IS, J, J1, J2, JNXT, K, KI, N2
REAL BETA, BIGNUM, EMAX, OVFL, REC, REMAX, SCALE,
$ SMIN, SMLNUM, ULP, UNFL, VCRIT, VMAX, WI, WR,
$ XNORM
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. External Functions ..
</span> LOGICAL <a name="LSAME.158"></a><a href="lsame.f.html#LSAME.1">LSAME</a>
INTEGER ISAMAX
REAL SDOT, <a name="SLAMCH.160"></a><a href="slamch.f.html#SLAMCH.1">SLAMCH</a>
EXTERNAL <a name="LSAME.161"></a><a href="lsame.f.html#LSAME.1">LSAME</a>, ISAMAX, SDOT, <a name="SLAMCH.161"></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"> .. External Subroutines ..
</span> EXTERNAL SAXPY, SCOPY, SGEMV, <a name="SLABAD.164"></a><a href="slabad.f.html#SLABAD.1">SLABAD</a>, <a name="SLALN2.164"></a><a href="slaln2.f.html#SLALN2.1">SLALN2</a>, SSCAL,
$ <a name="XERBLA.165"></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"> .. Intrinsic Functions ..
</span> INTRINSIC ABS, MAX, SQRT
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Local Arrays ..
</span> REAL X( 2, 2 )
<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> BOTHV = <a name="LSAME.177"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( SIDE, <span class="string">'B'</span> )
RIGHTV = <a name="LSAME.178"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( SIDE, <span class="string">'R'</span> ) .OR. BOTHV
LEFTV = <a name="LSAME.179"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( SIDE, <span class="string">'L'</span> ) .OR. BOTHV
<span class="comment">*</span><span class="comment">
</span> ALLV = <a name="LSAME.181"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( HOWMNY, <span class="string">'A'</span> )
OVER = <a name="LSAME.182"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( HOWMNY, <span class="string">'B'</span> )
SOMEV = <a name="LSAME.183"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( HOWMNY, <span class="string">'S'</span> )
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?