sggev.f.html
来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 514 行 · 第 1/3 页
HTML
514 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>sggev.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="SGGEV.1"></a><a href="sggev.f.html#SGGEV.1">SGGEV</a>( JOBVL, JOBVR, N, A, LDA, B, LDB, ALPHAR, ALPHAI,
$ BETA, VL, LDVL, VR, LDVR, WORK, LWORK, 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 JOBVL, JOBVR
INTEGER INFO, LDA, LDB, LDVL, LDVR, LWORK, N
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Array Arguments ..
</span> REAL A( LDA, * ), ALPHAI( * ), ALPHAR( * ),
$ B( LDB, * ), BETA( * ), 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="SGGEV.21"></a><a href="sggev.f.html#SGGEV.1">SGGEV</a> computes for a pair of N-by-N real nonsymmetric matrices (A,B)
</span><span class="comment">*</span><span class="comment"> the generalized eigenvalues, and optionally, the left and/or right
</span><span class="comment">*</span><span class="comment"> generalized eigenvectors.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> A generalized eigenvalue for a pair of matrices (A,B) is a scalar
</span><span class="comment">*</span><span class="comment"> lambda or a ratio alpha/beta = lambda, such that A - lambda*B is
</span><span class="comment">*</span><span class="comment"> singular. It is usually represented as the pair (alpha,beta), as
</span><span class="comment">*</span><span class="comment"> there is a reasonable interpretation for beta=0, and even for both
</span><span class="comment">*</span><span class="comment"> being zero.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> The right eigenvector v(j) corresponding to the eigenvalue lambda(j)
</span><span class="comment">*</span><span class="comment"> of (A,B) satisfies
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> A * v(j) = lambda(j) * B * v(j).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> The left eigenvector u(j) corresponding to the eigenvalue lambda(j)
</span><span class="comment">*</span><span class="comment"> of (A,B) satisfies
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> u(j)**H * A = lambda(j) * u(j)**H * B .
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> where u(j)**H is the conjugate-transpose of u(j).
</span><span class="comment">*</span><span class="comment">
</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"> JOBVL (input) CHARACTER*1
</span><span class="comment">*</span><span class="comment"> = 'N': do not compute the left generalized eigenvectors;
</span><span class="comment">*</span><span class="comment"> = 'V': compute the left generalized eigenvectors.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> JOBVR (input) CHARACTER*1
</span><span class="comment">*</span><span class="comment"> = 'N': do not compute the right generalized eigenvectors;
</span><span class="comment">*</span><span class="comment"> = 'V': compute the right generalized eigenvectors.
</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 A, B, VL, and VR. N >= 0.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> A (input/output) REAL array, dimension (LDA, N)
</span><span class="comment">*</span><span class="comment"> On entry, the matrix A in the pair (A,B).
</span><span class="comment">*</span><span class="comment"> On exit, A has been overwritten.
</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 A. LDA >= max(1,N).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> B (input/output) REAL array, dimension (LDB, N)
</span><span class="comment">*</span><span class="comment"> On entry, the matrix B in the pair (A,B).
</span><span class="comment">*</span><span class="comment"> On exit, B has been overwritten.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> LDB (input) INTEGER
</span><span class="comment">*</span><span class="comment"> The leading dimension of B. LDB >= max(1,N).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> ALPHAR (output) REAL array, dimension (N)
</span><span class="comment">*</span><span class="comment"> ALPHAI (output) REAL array, dimension (N)
</span><span class="comment">*</span><span class="comment"> BETA (output) REAL array, dimension (N)
</span><span class="comment">*</span><span class="comment"> On exit, (ALPHAR(j) + ALPHAI(j)*i)/BETA(j), j=1,...,N, will
</span><span class="comment">*</span><span class="comment"> be the generalized eigenvalues. If ALPHAI(j) is zero, then
</span><span class="comment">*</span><span class="comment"> the j-th eigenvalue is real; if positive, then the j-th and
</span><span class="comment">*</span><span class="comment"> (j+1)-st eigenvalues are a complex conjugate pair, with
</span><span class="comment">*</span><span class="comment"> ALPHAI(j+1) negative.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Note: the quotients ALPHAR(j)/BETA(j) and ALPHAI(j)/BETA(j)
</span><span class="comment">*</span><span class="comment"> may easily over- or underflow, and BETA(j) may even be zero.
</span><span class="comment">*</span><span class="comment"> Thus, the user should avoid naively computing the ratio
</span><span class="comment">*</span><span class="comment"> alpha/beta. However, ALPHAR and ALPHAI will be always less
</span><span class="comment">*</span><span class="comment"> than and usually comparable with norm(A) in magnitude, and
</span><span class="comment">*</span><span class="comment"> BETA always less than and usually comparable with norm(B).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> VL (output) REAL array, dimension (LDVL,N)
</span><span class="comment">*</span><span class="comment"> If JOBVL = 'V', the left eigenvectors u(j) are stored one
</span><span class="comment">*</span><span class="comment"> after another in the columns of VL, in the same order as
</span><span class="comment">*</span><span class="comment"> their eigenvalues. If the j-th eigenvalue is real, then
</span><span class="comment">*</span><span class="comment"> u(j) = VL(:,j), the j-th column of VL. If the j-th and
</span><span class="comment">*</span><span class="comment"> (j+1)-th eigenvalues form a complex conjugate pair, then
</span><span class="comment">*</span><span class="comment"> u(j) = VL(:,j)+i*VL(:,j+1) and u(j+1) = VL(:,j)-i*VL(:,j+1).
</span><span class="comment">*</span><span class="comment"> Each eigenvector is scaled so the largest component has
</span><span class="comment">*</span><span class="comment"> abs(real part)+abs(imag. part)=1.
</span><span class="comment">*</span><span class="comment"> Not referenced if JOBVL = 'N'.
</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 matrix VL. LDVL >= 1, and
</span><span class="comment">*</span><span class="comment"> if JOBVL = 'V', LDVL >= N.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> VR (output) REAL array, dimension (LDVR,N)
</span><span class="comment">*</span><span class="comment"> If JOBVR = 'V', the right eigenvectors v(j) are stored one
</span><span class="comment">*</span><span class="comment"> after another in the columns of VR, in the same order as
</span><span class="comment">*</span><span class="comment"> their eigenvalues. If the j-th eigenvalue is real, then
</span><span class="comment">*</span><span class="comment"> v(j) = VR(:,j), the j-th column of VR. If the j-th and
</span><span class="comment">*</span><span class="comment"> (j+1)-th eigenvalues form a complex conjugate pair, then
</span><span class="comment">*</span><span class="comment"> v(j) = VR(:,j)+i*VR(:,j+1) and v(j+1) = VR(:,j)-i*VR(:,j+1).
</span><span class="comment">*</span><span class="comment"> Each eigenvector is scaled so the largest component has
</span><span class="comment">*</span><span class="comment"> abs(real part)+abs(imag. part)=1.
</span><span class="comment">*</span><span class="comment"> Not referenced if JOBVR = 'N'.
</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 matrix VR. LDVR >= 1, and
</span><span class="comment">*</span><span class="comment"> if JOBVR = 'V', LDVR >= N.
</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. LWORK >= max(1,8*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.128"></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"> 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. No eigenvectors have been
</span><span class="comment">*</span><span class="comment"> calculated, but ALPHAR(j), ALPHAI(j), and BETA(j)
</span><span class="comment">*</span><span class="comment"> should 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.137"></a><a href="shgeqz.f.html#SHGEQZ.1">SHGEQZ</a>.
</span><span class="comment">*</span><span class="comment"> =N+2: error return from <a name="STGEVC.138"></a><a href="stgevc.f.html#STGEVC.1">STGEVC</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.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 ILASCL, ILBSCL, ILV, ILVL, ILVR, LQUERY
CHARACTER CHTEMP
INTEGER ICOLS, IERR, IHI, IJOBVL, IJOBVR, ILEFT, ILO,
$ IN, IRIGHT, IROWS, ITAU, IWRK, JC, JR, MAXWRK,
$ MINWRK
REAL ANRM, ANRMTO, BIGNUM, BNRM, BNRMTO, EPS,
$ SMLNUM, TEMP
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?