zhseqr.f.html
来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 420 行 · 第 1/3 页
HTML
420 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>zhseqr.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="ZHSEQR.1"></a><a href="zhseqr.f.html#ZHSEQR.1">ZHSEQR</a>( JOB, COMPZ, N, ILO, IHI, H, LDH, W, Z, LDZ,
$ 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> INTEGER IHI, ILO, INFO, LDH, LDZ, LWORK, N
CHARACTER COMPZ, JOB
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Array Arguments ..
</span> COMPLEX*16 H( LDH, * ), W( * ), WORK( * ), Z( LDZ, * )
<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="ZHSEQR.18"></a><a href="zhseqr.f.html#ZHSEQR.1">ZHSEQR</a> computes the eigenvalues of a Hessenberg matrix H
</span><span class="comment">*</span><span class="comment"> and, optionally, the matrices T and Z from the Schur decomposition
</span><span class="comment">*</span><span class="comment"> H = Z T Z**H, where T is an upper triangular matrix (the
</span><span class="comment">*</span><span class="comment"> Schur form), and Z is the unitary matrix of Schur vectors.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Optionally Z may be postmultiplied into an input unitary
</span><span class="comment">*</span><span class="comment"> matrix Q so that this routine can give the Schur factorization
</span><span class="comment">*</span><span class="comment"> of a matrix A which has been reduced to the Hessenberg form H
</span><span class="comment">*</span><span class="comment"> by the unitary matrix Q: A = Q*H*Q**H = (QZ)*H*(QZ)**H.
</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"> JOB (input) CHARACTER*1
</span><span class="comment">*</span><span class="comment"> = 'E': compute eigenvalues only;
</span><span class="comment">*</span><span class="comment"> = 'S': compute eigenvalues and the Schur form T.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> COMPZ (input) CHARACTER*1
</span><span class="comment">*</span><span class="comment"> = 'N': no Schur vectors are computed;
</span><span class="comment">*</span><span class="comment"> = 'I': Z is initialized to the unit matrix and the matrix Z
</span><span class="comment">*</span><span class="comment"> of Schur vectors of H is returned;
</span><span class="comment">*</span><span class="comment"> = 'V': Z must contain an unitary matrix Q on entry, and
</span><span class="comment">*</span><span class="comment"> the product Q*Z is returned.
</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 H. N .GE. 0.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> ILO (input) INTEGER
</span><span class="comment">*</span><span class="comment"> IHI (input) INTEGER
</span><span class="comment">*</span><span class="comment"> It is assumed that H is already upper triangular in rows
</span><span class="comment">*</span><span class="comment"> and columns 1:ILO-1 and IHI+1:N. ILO and IHI are normally
</span><span class="comment">*</span><span class="comment"> set by a previous call to <a name="ZGEBAL.49"></a><a href="zgebal.f.html#ZGEBAL.1">ZGEBAL</a>, and then passed to <a name="ZGEHRD.49"></a><a href="zgehrd.f.html#ZGEHRD.1">ZGEHRD</a>
</span><span class="comment">*</span><span class="comment"> when the matrix output by <a name="ZGEBAL.50"></a><a href="zgebal.f.html#ZGEBAL.1">ZGEBAL</a> is reduced to Hessenberg
</span><span class="comment">*</span><span class="comment"> form. Otherwise ILO and IHI should be set to 1 and N
</span><span class="comment">*</span><span class="comment"> respectively. If N.GT.0, then 1.LE.ILO.LE.IHI.LE.N.
</span><span class="comment">*</span><span class="comment"> If N = 0, then ILO = 1 and IHI = 0.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> H (input/output) COMPLEX*16 array, dimension (LDH,N)
</span><span class="comment">*</span><span class="comment"> On entry, the upper Hessenberg matrix H.
</span><span class="comment">*</span><span class="comment"> On exit, if INFO = 0 and JOB = 'S', H contains the upper
</span><span class="comment">*</span><span class="comment"> triangular matrix T from the Schur decomposition (the
</span><span class="comment">*</span><span class="comment"> Schur form). If INFO = 0 and JOB = 'E', the contents of
</span><span class="comment">*</span><span class="comment"> H are unspecified on exit. (The output value of H when
</span><span class="comment">*</span><span class="comment"> INFO.GT.0 is given under the description of INFO below.)
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Unlike earlier versions of <a name="ZHSEQR.63"></a><a href="zhseqr.f.html#ZHSEQR.1">ZHSEQR</a>, this subroutine may
</span><span class="comment">*</span><span class="comment"> explicitly H(i,j) = 0 for i.GT.j and j = 1, 2, ... ILO-1
</span><span class="comment">*</span><span class="comment"> or j = IHI+1, IHI+2, ... N.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> LDH (input) INTEGER
</span><span class="comment">*</span><span class="comment"> The leading dimension of the array H. LDH .GE. max(1,N).
</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"> The computed eigenvalues. If JOB = 'S', the eigenvalues are
</span><span class="comment">*</span><span class="comment"> stored in the same order as on the diagonal of the Schur
</span><span class="comment">*</span><span class="comment"> form returned in H, with W(i) = H(i,i).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Z (input/output) COMPLEX*16 array, dimension (LDZ,N)
</span><span class="comment">*</span><span class="comment"> If COMPZ = 'N', Z is not referenced.
</span><span class="comment">*</span><span class="comment"> If COMPZ = 'I', on entry Z need not be set and on exit,
</span><span class="comment">*</span><span class="comment"> if INFO = 0, Z contains the unitary matrix Z of the Schur
</span><span class="comment">*</span><span class="comment"> vectors of H. If COMPZ = 'V', on entry Z must contain an
</span><span class="comment">*</span><span class="comment"> N-by-N matrix Q, which is assumed to be equal to the unit
</span><span class="comment">*</span><span class="comment"> matrix except for the submatrix Z(ILO:IHI,ILO:IHI). On exit,
</span><span class="comment">*</span><span class="comment"> if INFO = 0, Z contains Q*Z.
</span><span class="comment">*</span><span class="comment"> Normally Q is the unitary matrix generated by <a name="ZUNGHR.83"></a><a href="zunghr.f.html#ZUNGHR.1">ZUNGHR</a>
</span><span class="comment">*</span><span class="comment"> after the call to <a name="ZGEHRD.84"></a><a href="zgehrd.f.html#ZGEHRD.1">ZGEHRD</a> which formed the Hessenberg matrix
</span><span class="comment">*</span><span class="comment"> H. (The output value of Z when INFO.GT.0 is given under
</span><span class="comment">*</span><span class="comment"> the description of INFO below.)
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> LDZ (input) INTEGER
</span><span class="comment">*</span><span class="comment"> The leading dimension of the array Z. if COMPZ = 'I' or
</span><span class="comment">*</span><span class="comment"> COMPZ = 'V', then LDZ.GE.MAX(1,N). Otherwize, LDZ.GE.1.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> WORK (workspace/output) COMPLEX*16 array, dimension (LWORK)
</span><span class="comment">*</span><span class="comment"> On exit, if INFO = 0, WORK(1) returns an estimate of
</span><span class="comment">*</span><span class="comment"> the optimal value for 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 .GE. max(1,N)
</span><span class="comment">*</span><span class="comment"> is sufficient, but LWORK typically as large as 6*N may
</span><span class="comment">*</span><span class="comment"> be required for optimal performance. A workspace query
</span><span class="comment">*</span><span class="comment"> to determine the optimal workspace size is recommended.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> If LWORK = -1, then <a name="ZHSEQR.102"></a><a href="zhseqr.f.html#ZHSEQR.1">ZHSEQR</a> does a workspace query.
</span><span class="comment">*</span><span class="comment"> In this case, <a name="ZHSEQR.103"></a><a href="zhseqr.f.html#ZHSEQR.1">ZHSEQR</a> checks the input parameters and
</span><span class="comment">*</span><span class="comment"> estimates the optimal workspace size for the given
</span><span class="comment">*</span><span class="comment"> values of N, ILO and IHI. The estimate is returned
</span><span class="comment">*</span><span class="comment"> in WORK(1). No error message related to LWORK is
</span><span class="comment">*</span><span class="comment"> issued by <a name="XERBLA.107"></a><a href="xerbla.f.html#XERBLA.1">XERBLA</a>. Neither H nor Z are accessed.
</span><span class="comment">*</span><span class="comment">
</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"> .LT. 0: if INFO = -i, the i-th argument had an illegal
</span><span class="comment">*</span><span class="comment"> value
</span><span class="comment">*</span><span class="comment"> .GT. 0: if INFO = i, <a name="ZHSEQR.114"></a><a href="zhseqr.f.html#ZHSEQR.1">ZHSEQR</a> failed to compute all of
</span><span class="comment">*</span><span class="comment"> the eigenvalues. Elements 1:ilo-1 and i+1:n of WR
</span><span class="comment">*</span><span class="comment"> and WI contain those eigenvalues which have been
</span><span class="comment">*</span><span class="comment"> successfully computed. (Failures are rare.)
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> If INFO .GT. 0 and JOB = 'E', then on exit, the
</span><span class="comment">*</span><span class="comment"> remaining unconverged eigenvalues are the eigen-
</span><span class="comment">*</span><span class="comment"> values of the upper Hessenberg matrix rows and
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?