claqr0.f.html
来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 626 行 · 第 1/4 页
HTML
626 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>claqr0.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="CLAQR0.1"></a><a href="claqr0.f.html#CLAQR0.1">CLAQR0</a>( WANTT, WANTZ, N, ILO, IHI, H, LDH, W, ILOZ,
$ IHIZ, Z, LDZ, WORK, LWORK, INFO )
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> -- LAPACK auxiliary 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, IHIZ, ILO, ILOZ, INFO, LDH, LDZ, LWORK, N
LOGICAL WANTT, WANTZ
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Array Arguments ..
</span> COMPLEX H( LDH, * ), W( * ), WORK( * ), Z( LDZ, * )
<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="CLAQR0.19"></a><a href="claqr0.f.html#CLAQR0.1">CLAQR0</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"> WANTT (input) LOGICAL
</span><span class="comment">*</span><span class="comment"> = .TRUE. : the full Schur form T is required;
</span><span class="comment">*</span><span class="comment"> = .FALSE.: only eigenvalues are required.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> WANTZ (input) LOGICAL
</span><span class="comment">*</span><span class="comment"> = .TRUE. : the matrix of Schur vectors Z is required;
</span><span class="comment">*</span><span class="comment"> = .FALSE.: Schur vectors are not required.
</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 and, if ILO.GT.1,
</span><span class="comment">*</span><span class="comment"> H(ILO,ILO-1) is zero. ILO and IHI are normally set by a
</span><span class="comment">*</span><span class="comment"> previous call to <a name="CGEBAL.48"></a><a href="cgebal.f.html#CGEBAL.1">CGEBAL</a>, and then passed to <a name="CGEHRD.48"></a><a href="cgehrd.f.html#CGEHRD.1">CGEHRD</a> when the
</span><span class="comment">*</span><span class="comment"> matrix output by <a name="CGEBAL.49"></a><a href="cgebal.f.html#CGEBAL.1">CGEBAL</a> is reduced to Hessenberg form.
</span><span class="comment">*</span><span class="comment"> 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 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 WANTT is .TRUE., then H
</span><span class="comment">*</span><span class="comment"> contains the upper triangular matrix T from the Schur
</span><span class="comment">*</span><span class="comment"> decomposition (the Schur form). If INFO = 0 and WANT is
</span><span class="comment">*</span><span class="comment"> .FALSE., then the contents of H are unspecified on exit.
</span><span class="comment">*</span><span class="comment"> (The output value of H when INFO.GT.0 is given under the
</span><span class="comment">*</span><span class="comment"> description of INFO below.)
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> This subroutine may explicitly set H(i,j) = 0 for i.GT.j and
</span><span class="comment">*</span><span class="comment"> j = 1, 2, ... ILO-1 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 array, dimension (N)
</span><span class="comment">*</span><span class="comment"> The computed eigenvalues of H(ILO:IHI,ILO:IHI) are stored
</span><span class="comment">*</span><span class="comment"> in W(ILO:IHI). If WANTT is .TRUE., then 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 array, dimension (LDZ,IHI)
</span><span class="comment">*</span><span class="comment"> If WANTZ is .FALSE., then Z is not referenced.
</span><span class="comment">*</span><span class="comment"> If WANTZ is .TRUE., then Z(ILO:IHI,ILOZ:IHIZ) is
</span><span class="comment">*</span><span class="comment"> replaced by Z(ILO:IHI,ILOZ:IHIZ)*U where U is the
</span><span class="comment">*</span><span class="comment"> orthogonal Schur factor of H(ILO:IHI,ILO:IHI).
</span><span class="comment">*</span><span class="comment"> (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 WANTZ is .TRUE.
</span><span class="comment">*</span><span class="comment"> then LDZ.GE.MAX(1,IHIZ). Otherwize, LDZ.GE.1.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> WORK (workspace/output) COMPLEX array, dimension LWORK
</span><span class="comment">*</span><span class="comment"> On exit, if LWORK = -1, 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="CLAQR0.97"></a><a href="claqr0.f.html#CLAQR0.1">CLAQR0</a> does a workspace query.
</span><span class="comment">*</span><span class="comment"> In this case, <a name="CLAQR0.98"></a><a href="claqr0.f.html#CLAQR0.1">CLAQR0</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.102"></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"> .GT. 0: if INFO = i, <a name="CLAQR0.107"></a><a href="claqr0.f.html#CLAQR0.1">CLAQR0</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 WANT is .FALSE., then on exit,
</span><span class="comment">*</span><span class="comment"> the remaining unconverged eigenvalues are the eigen-
</span><span class="comment">*</span><span class="comment"> values of the upper Hessenberg matrix rows and
</span><span class="comment">*</span><span class="comment"> columns ILO through INFO of the final, output
</span><span class="comment">*</span><span class="comment"> value of H.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> If INFO .GT. 0 and WANTT is .TRUE., then on exit
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> (*) (initial value of H)*U = U*(final value of H)
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> where U is a unitary matrix. The final
</span><span class="comment">*</span><span class="comment"> value of H is upper Hessenberg and triangular in
</span><span class="comment">*</span><span class="comment"> rows and columns INFO+1 through IHI.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> If INFO .GT. 0 and WANTZ is .TRUE., then on exit
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> (final value of Z(ILO:IHI,ILOZ:IHIZ)
</span><span class="comment">*</span><span class="comment"> = (initial value of Z(ILO:IHI,ILOZ:IHIZ)*U
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> where U is the unitary matrix in (*) (regard-
</span><span class="comment">*</span><span class="comment"> less of the value of WANTT.)
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> If INFO .GT. 0 and WANTZ is .FALSE., then Z is not
</span><span class="comment">*</span><span class="comment"> 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"> Based on contributions by
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?