slahqr.f.html
来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 526 行 · 第 1/3 页
HTML
526 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>slahqr.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="SLAHQR.1"></a><a href="slahqr.f.html#SLAHQR.1">SLAHQR</a>( WANTT, WANTZ, N, ILO, IHI, H, LDH, WR, WI,
$ ILOZ, IHIZ, Z, LDZ, 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, N
LOGICAL WANTT, WANTZ
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Array Arguments ..
</span> REAL H( LDH, * ), WI( * ), WR( * ), 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="SLAHQR.19"></a><a href="slahqr.f.html#SLAHQR.1">SLAHQR</a> is an auxiliary routine called by <a name="SHSEQR.19"></a><a href="shseqr.f.html#SHSEQR.1">SHSEQR</a> to update the
</span><span class="comment">*</span><span class="comment"> eigenvalues and Schur decomposition already computed by <a name="SHSEQR.20"></a><a href="shseqr.f.html#SHSEQR.1">SHSEQR</a>, by
</span><span class="comment">*</span><span class="comment"> dealing with the Hessenberg submatrix in rows and columns ILO to
</span><span class="comment">*</span><span class="comment"> IHI.
</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 >= 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 quasi-triangular in
</span><span class="comment">*</span><span class="comment"> rows and columns IHI+1:N, and that H(ILO,ILO-1) = 0 (unless
</span><span class="comment">*</span><span class="comment"> ILO = 1). <a name="SLAHQR.42"></a><a href="slahqr.f.html#SLAHQR.1">SLAHQR</a> works primarily with the Hessenberg
</span><span class="comment">*</span><span class="comment"> submatrix in rows and columns ILO to IHI, but applies
</span><span class="comment">*</span><span class="comment"> transformations to all of H if WANTT is .TRUE..
</span><span class="comment">*</span><span class="comment"> 1 <= ILO <= max(1,IHI); IHI <= N.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> H (input/output) REAL 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 is zero and if WANTT is .TRUE., H is upper
</span><span class="comment">*</span><span class="comment"> quasi-triangular in rows and columns ILO:IHI, with any
</span><span class="comment">*</span><span class="comment"> 2-by-2 diagonal blocks in standard form. If INFO is zero
</span><span class="comment">*</span><span class="comment"> and WANTT is .FALSE., the contents of H are unspecified on
</span><span class="comment">*</span><span class="comment"> exit. The output state of H if INFO is nonzero is given
</span><span class="comment">*</span><span class="comment"> below under the description of INFO.
</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 >= max(1,N).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> WR (output) REAL array, dimension (N)
</span><span class="comment">*</span><span class="comment"> WI (output) REAL array, dimension (N)
</span><span class="comment">*</span><span class="comment"> The real and imaginary parts, respectively, of the computed
</span><span class="comment">*</span><span class="comment"> eigenvalues ILO to IHI are stored in the corresponding
</span><span class="comment">*</span><span class="comment"> elements of WR and WI. If two eigenvalues are computed as a
</span><span class="comment">*</span><span class="comment"> complex conjugate pair, they are stored in consecutive
</span><span class="comment">*</span><span class="comment"> elements of WR and WI, say the i-th and (i+1)th, with
</span><span class="comment">*</span><span class="comment"> WI(i) > 0 and WI(i+1) < 0. If WANTT is .TRUE., the
</span><span class="comment">*</span><span class="comment"> eigenvalues are stored in the same order as on the diagonal
</span><span class="comment">*</span><span class="comment"> of the Schur form returned in H, with WR(i) = H(i,i), and, if
</span><span class="comment">*</span><span class="comment"> H(i:i+1,i:i+1) is a 2-by-2 diagonal block,
</span><span class="comment">*</span><span class="comment"> WI(i) = sqrt(H(i+1,i)*H(i,i+1)) and WI(i+1) = -WI(i).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> ILOZ (input) INTEGER
</span><span class="comment">*</span><span class="comment"> IHIZ (input) INTEGER
</span><span class="comment">*</span><span class="comment"> Specify the rows of Z to which transformations must be
</span><span class="comment">*</span><span class="comment"> applied if WANTZ is .TRUE..
</span><span class="comment">*</span><span class="comment"> 1 <= ILOZ <= ILO; IHI <= IHIZ <= N.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Z (input/output) REAL array, dimension (LDZ,N)
</span><span class="comment">*</span><span class="comment"> If WANTZ is .TRUE., on entry Z must contain the current
</span><span class="comment">*</span><span class="comment"> matrix Z of transformations accumulated by <a name="SHSEQR.80"></a><a href="shseqr.f.html#SHSEQR.1">SHSEQR</a>, and on
</span><span class="comment">*</span><span class="comment"> exit Z has been updated; transformations are applied only to
</span><span class="comment">*</span><span class="comment"> the submatrix Z(ILOZ:IHIZ,ILO:IHI).
</span><span class="comment">*</span><span class="comment"> If WANTZ is .FALSE., Z is not referenced.
</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. LDZ >= max(1,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"> .GT. 0: If INFO = i, <a name="SLAHQR.90"></a><a href="slahqr.f.html#SLAHQR.1">SLAHQR</a> failed to compute all the
</span><span class="comment">*</span><span class="comment"> eigenvalues ILO to IHI in a total of 30 iterations
</span><span class="comment">*</span><span class="comment"> per eigenvalue; elements i+1:ihi of WR and WI
</span><span class="comment">*</span><span class="comment"> contain those eigenvalues which have been
</span><span class="comment">*</span><span class="comment"> successfully computed.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> If INFO .GT. 0 and WANTT is .FALSE., then on exit,
</span><span class="comment">*</span><span class="comment"> the remaining unconverged eigenvalues are the
</span><span class="comment">*</span><span class="comment"> eigenvalues of the upper Hessenberg matrix rows
</span><span class="comment">*</span><span class="comment"> and columns ILO thorugh 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"> (*) (initial value of H)*U = U*(final value of H)
</span><span class="comment">*</span><span class="comment"> where U is an orthognal 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"> (final value of Z) = (initial value of Z)*U
</span><span class="comment">*</span><span class="comment"> where U is the orthogonal matrix in (*)
</span><span class="comment">*</span><span class="comment"> (regardless of the value of WANTT.)
</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"> 02-96 Based on modifications by
</span><span class="comment">*</span><span class="comment"> David Day, Sandia National Laboratory, USA
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> 12-04 Further modifications by
</span><span class="comment">*</span><span class="comment"> Ralph Byers, University of Kansas, USA
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> This is a modified version of <a name="SLAHQR.122"></a><a href="slahqr.f.html#SLAHQR.1">SLAHQR</a> from LAPACK version 3.0.
</span><span class="comment">*</span><span class="comment"> It is (1) more robust against overflow and underflow and
</span><span class="comment">*</span><span class="comment"> (2) adopts the more conservative Ahues & Tisseur stopping
</span><span class="comment">*</span><span class="comment"> criterion (LAWN 122, 1997).
</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> INTEGER ITMAX
PARAMETER ( ITMAX = 30 )
REAL ZERO, ONE, TWO
PARAMETER ( ZERO = 0.0e0, ONE = 1.0e0, TWO = 2.0e0 )
REAL DAT1, DAT2
PARAMETER ( DAT1 = 3.0e0 / 4.0e0, DAT2 = -0.4375e0 )
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Local Scalars ..
</span> REAL AA, AB, BA, BB, CS, DET, H11, H12, H21, H21S,
$ H22, RT1I, RT1R, RT2I, RT2R, RTDISC, S, SAFMAX,
$ SAFMIN, SMLNUM, SN, SUM, T1, T2, T3, TR, TST,
$ ULP, V2, V3
INTEGER I, I1, I2, ITS, J, K, L, M, NH, NR, NZ
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Local Arrays ..
</span> REAL V( 3 )
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. External Functions ..
</span> REAL <a name="SLAMCH.148"></a><a href="slamch.f.html#SLAMCH.1">SLAMCH</a>
EXTERNAL <a name="SLAMCH.149"></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 SCOPY, <a name="SLABAD.152"></a><a href="slabad.f.html#SLABAD.1">SLABAD</a>, <a name="SLANV2.152"></a><a href="slanv2.f.html#SLANV2.1">SLANV2</a>, <a name="SLARFG.152"></a><a href="slarfg.f.html#SLARFG.1">SLARFG</a>, SROT
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Intrinsic Functions ..
</span> INTRINSIC ABS, MAX, MIN, REAL, SQRT
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Executable Statements ..
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?