slaqr5.f.html
来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 837 行 · 第 1/5 页
HTML
837 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>slaqr5.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="SLAQR5.1"></a><a href="slaqr5.f.html#SLAQR5.1">SLAQR5</a>( WANTT, WANTZ, KACC22, N, KTOP, KBOT, NSHFTS,
$ SR, SI, H, LDH, ILOZ, IHIZ, Z, LDZ, V, LDV, U,
$ LDU, NV, WV, LDWV, NH, WH, LDWH )
<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 IHIZ, ILOZ, KACC22, KBOT, KTOP, LDH, LDU, LDV,
$ LDWH, LDWV, LDZ, N, NH, NSHFTS, NV
LOGICAL WANTT, WANTZ
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Array Arguments ..
</span> REAL H( LDH, * ), SI( * ), SR( * ), U( LDU, * ),
$ V( LDV, * ), WH( LDWH, * ), WV( LDWV, * ),
$ 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"> This auxiliary subroutine called by <a name="SLAQR0.20"></a><a href="slaqr0.f.html#SLAQR0.1">SLAQR0</a> performs a
</span><span class="comment">*</span><span class="comment"> single small-bulge multi-shift QR sweep.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> WANTT (input) logical scalar
</span><span class="comment">*</span><span class="comment"> WANTT = .true. if the quasi-triangular Schur factor
</span><span class="comment">*</span><span class="comment"> is being computed. WANTT is set to .false. otherwise.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> WANTZ (input) logical scalar
</span><span class="comment">*</span><span class="comment"> WANTZ = .true. if the orthogonal Schur factor is being
</span><span class="comment">*</span><span class="comment"> computed. WANTZ is set to .false. otherwise.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> KACC22 (input) integer with value 0, 1, or 2.
</span><span class="comment">*</span><span class="comment"> Specifies the computation mode of far-from-diagonal
</span><span class="comment">*</span><span class="comment"> orthogonal updates.
</span><span class="comment">*</span><span class="comment"> = 0: <a name="SLAQR5.34"></a><a href="slaqr5.f.html#SLAQR5.1">SLAQR5</a> does not accumulate reflections and does not
</span><span class="comment">*</span><span class="comment"> use matrix-matrix multiply to update far-from-diagonal
</span><span class="comment">*</span><span class="comment"> matrix entries.
</span><span class="comment">*</span><span class="comment"> = 1: <a name="SLAQR5.37"></a><a href="slaqr5.f.html#SLAQR5.1">SLAQR5</a> accumulates reflections and uses matrix-matrix
</span><span class="comment">*</span><span class="comment"> multiply to update the far-from-diagonal matrix entries.
</span><span class="comment">*</span><span class="comment"> = 2: <a name="SLAQR5.39"></a><a href="slaqr5.f.html#SLAQR5.1">SLAQR5</a> accumulates reflections, uses matrix-matrix
</span><span class="comment">*</span><span class="comment"> multiply to update the far-from-diagonal matrix entries,
</span><span class="comment">*</span><span class="comment"> and takes advantage of 2-by-2 block structure during
</span><span class="comment">*</span><span class="comment"> matrix multiplies.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> N (input) integer scalar
</span><span class="comment">*</span><span class="comment"> N is the order of the Hessenberg matrix H upon which this
</span><span class="comment">*</span><span class="comment"> subroutine operates.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> KTOP (input) integer scalar
</span><span class="comment">*</span><span class="comment"> KBOT (input) integer scalar
</span><span class="comment">*</span><span class="comment"> These are the first and last rows and columns of an
</span><span class="comment">*</span><span class="comment"> isolated diagonal block upon which the QR sweep is to be
</span><span class="comment">*</span><span class="comment"> applied. It is assumed without a check that
</span><span class="comment">*</span><span class="comment"> either KTOP = 1 or H(KTOP,KTOP-1) = 0
</span><span class="comment">*</span><span class="comment"> and
</span><span class="comment">*</span><span class="comment"> either KBOT = N or H(KBOT+1,KBOT) = 0.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> NSHFTS (input) integer scalar
</span><span class="comment">*</span><span class="comment"> NSHFTS gives the number of simultaneous shifts. NSHFTS
</span><span class="comment">*</span><span class="comment"> must be positive and even.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> SR (input) REAL array of size (NSHFTS)
</span><span class="comment">*</span><span class="comment"> SI (input) REAL array of size (NSHFTS)
</span><span class="comment">*</span><span class="comment"> SR contains the real parts and SI contains the imaginary
</span><span class="comment">*</span><span class="comment"> parts of the NSHFTS shifts of origin that define the
</span><span class="comment">*</span><span class="comment"> multi-shift QR sweep.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> H (input/output) REAL array of size (LDH,N)
</span><span class="comment">*</span><span class="comment"> On input H contains a Hessenberg matrix. On output a
</span><span class="comment">*</span><span class="comment"> multi-shift QR sweep with shifts SR(J)+i*SI(J) is applied
</span><span class="comment">*</span><span class="comment"> to the isolated diagonal block in rows and columns KTOP
</span><span class="comment">*</span><span class="comment"> through KBOT.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> LDH (input) integer scalar
</span><span class="comment">*</span><span class="comment"> LDH is the leading dimension of H just as declared in the
</span><span class="comment">*</span><span class="comment"> calling procedure. LDH.GE.MAX(1,N).
</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.. 1 .LE. ILOZ .LE. IHIZ .LE. N
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Z (input/output) REAL array of size (LDZ,IHI)
</span><span class="comment">*</span><span class="comment"> If WANTZ = .TRUE., then the QR Sweep orthogonal
</span><span class="comment">*</span><span class="comment"> similarity transformation is accumulated into
</span><span class="comment">*</span><span class="comment"> Z(ILOZ:IHIZ,ILO:IHI) from the right.
</span><span class="comment">*</span><span class="comment"> If WANTZ = .FALSE., then Z is unreferenced.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> LDZ (input) integer scalar
</span><span class="comment">*</span><span class="comment"> LDA is the leading dimension of Z just as declared in
</span><span class="comment">*</span><span class="comment"> the calling procedure. LDZ.GE.N.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> V (workspace) REAL array of size (LDV,NSHFTS/2)
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> LDV (input) integer scalar
</span><span class="comment">*</span><span class="comment"> LDV is the leading dimension of V as declared in the
</span><span class="comment">*</span><span class="comment"> calling procedure. LDV.GE.3.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> U (workspace) REAL array of size
</span><span class="comment">*</span><span class="comment"> (LDU,3*NSHFTS-3)
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> LDU (input) integer scalar
</span><span class="comment">*</span><span class="comment"> LDU is the leading dimension of U just as declared in the
</span><span class="comment">*</span><span class="comment"> in the calling subroutine. LDU.GE.3*NSHFTS-3.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> NH (input) integer scalar
</span><span class="comment">*</span><span class="comment"> NH is the number of columns in array WH available for
</span><span class="comment">*</span><span class="comment"> workspace. NH.GE.1.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> WH (workspace) REAL array of size (LDWH,NH)
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> LDWH (input) integer scalar
</span><span class="comment">*</span><span class="comment"> Leading dimension of WH just as declared in the
</span><span class="comment">*</span><span class="comment"> calling procedure. LDWH.GE.3*NSHFTS-3.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> NV (input) integer scalar
</span><span class="comment">*</span><span class="comment"> NV is the number of rows in WV agailable for workspace.
</span><span class="comment">*</span><span class="comment"> NV.GE.1.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> WV (workspace) REAL array of size
</span><span class="comment">*</span><span class="comment"> (LDWV,3*NSHFTS-3)
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> LDWV (input) integer scalar
</span><span class="comment">*</span><span class="comment"> LDWV is the leading dimension of WV as declared in the
</span><span class="comment">*</span><span class="comment"> in the calling subroutine. LDWV.GE.NV.
</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"> Based on contributions by
</span><span class="comment">*</span><span class="comment"> Karen Braman and Ralph Byers, Department of Mathematics,
</span><span class="comment">*</span><span class="comment"> University of Kansas, USA
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> ============================================================
</span><span class="comment">*</span><span class="comment"> Reference:
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> K. Braman, R. Byers and R. Mathias, The Multi-Shift QR
</span><span class="comment">*</span><span class="comment"> Algorithm Part I: Maintaining Well Focused Shifts, and
</span><span class="comment">*</span><span class="comment"> Level 3 Performance, SIAM Journal of Matrix Analysis,
</span><span class="comment">*</span><span class="comment"> volume 23, pages 929--947, 2002.
</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.0e0, ONE = 1.0e0 )
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Local Scalars ..
</span> REAL ALPHA, BETA, H11, H12, H21, H22, REFSUM,
$ SAFMAX, SAFMIN, SCL, SMLNUM, SWAP, TST1, TST2,
$ ULP
INTEGER I, I2, I4, INCOL, J, J2, J4, JBOT, JCOL, JLEN,
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?