zhsein.f.html
来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 375 行 · 第 1/2 页
HTML
375 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>zhsein.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="ZHSEIN.1"></a><a href="zhsein.f.html#ZHSEIN.1">ZHSEIN</a>( SIDE, EIGSRC, INITV, SELECT, N, H, LDH, W, VL,
$ LDVL, VR, LDVR, MM, M, WORK, RWORK, IFAILL,
$ IFAILR, INFO )
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> -- LAPACK 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 EIGSRC, INITV, SIDE
INTEGER INFO, LDH, LDVL, LDVR, M, MM, N
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Array Arguments ..
</span> LOGICAL SELECT( * )
INTEGER IFAILL( * ), IFAILR( * )
DOUBLE PRECISION RWORK( * )
COMPLEX*16 H( LDH, * ), VL( LDVL, * ), VR( LDVR, * ),
$ W( * ), 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="ZHSEIN.24"></a><a href="zhsein.f.html#ZHSEIN.1">ZHSEIN</a> uses inverse iteration to find specified right and/or left
</span><span class="comment">*</span><span class="comment"> eigenvectors of a complex upper Hessenberg matrix H.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> The right eigenvector x and the left eigenvector y of the matrix H
</span><span class="comment">*</span><span class="comment"> corresponding to an eigenvalue w are defined by:
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> H * x = w * x, y**h * H = w * y**h
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> where y**h denotes the conjugate transpose of the vector y.
</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"> SIDE (input) CHARACTER*1
</span><span class="comment">*</span><span class="comment"> = 'R': compute right eigenvectors only;
</span><span class="comment">*</span><span class="comment"> = 'L': compute left eigenvectors only;
</span><span class="comment">*</span><span class="comment"> = 'B': compute both right and left eigenvectors.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> EIGSRC (input) CHARACTER*1
</span><span class="comment">*</span><span class="comment"> Specifies the source of eigenvalues supplied in W:
</span><span class="comment">*</span><span class="comment"> = 'Q': the eigenvalues were found using <a name="ZHSEQR.44"></a><a href="zhseqr.f.html#ZHSEQR.1">ZHSEQR</a>; thus, if
</span><span class="comment">*</span><span class="comment"> H has zero subdiagonal elements, and so is
</span><span class="comment">*</span><span class="comment"> block-triangular, then the j-th eigenvalue can be
</span><span class="comment">*</span><span class="comment"> assumed to be an eigenvalue of the block containing
</span><span class="comment">*</span><span class="comment"> the j-th row/column. This property allows <a name="ZHSEIN.48"></a><a href="zhsein.f.html#ZHSEIN.1">ZHSEIN</a> to
</span><span class="comment">*</span><span class="comment"> perform inverse iteration on just one diagonal block.
</span><span class="comment">*</span><span class="comment"> = 'N': no assumptions are made on the correspondence
</span><span class="comment">*</span><span class="comment"> between eigenvalues and diagonal blocks. In this
</span><span class="comment">*</span><span class="comment"> case, <a name="ZHSEIN.52"></a><a href="zhsein.f.html#ZHSEIN.1">ZHSEIN</a> must always perform inverse iteration
</span><span class="comment">*</span><span class="comment"> using the whole matrix H.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> INITV (input) CHARACTER*1
</span><span class="comment">*</span><span class="comment"> = 'N': no initial vectors are supplied;
</span><span class="comment">*</span><span class="comment"> = 'U': user-supplied initial vectors are stored in the arrays
</span><span class="comment">*</span><span class="comment"> VL and/or VR.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> SELECT (input) LOGICAL array, dimension (N)
</span><span class="comment">*</span><span class="comment"> Specifies the eigenvectors to be computed. To select the
</span><span class="comment">*</span><span class="comment"> eigenvector corresponding to the eigenvalue W(j),
</span><span class="comment">*</span><span class="comment"> SELECT(j) must be set to .TRUE..
</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"> H (input) COMPLEX*16 array, dimension (LDH,N)
</span><span class="comment">*</span><span class="comment"> The upper Hessenberg matrix H.
</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"> W (input/output) COMPLEX*16 array, dimension (N)
</span><span class="comment">*</span><span class="comment"> On entry, the eigenvalues of H.
</span><span class="comment">*</span><span class="comment"> On exit, the real parts of W may have been altered since
</span><span class="comment">*</span><span class="comment"> close eigenvalues are perturbed slightly in searching for
</span><span class="comment">*</span><span class="comment"> independent eigenvectors.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> VL (input/output) COMPLEX*16 array, dimension (LDVL,MM)
</span><span class="comment">*</span><span class="comment"> On entry, if INITV = 'U' and SIDE = 'L' or 'B', VL must
</span><span class="comment">*</span><span class="comment"> contain starting vectors for the inverse iteration for the
</span><span class="comment">*</span><span class="comment"> left eigenvectors; the starting vector for each eigenvector
</span><span class="comment">*</span><span class="comment"> must be in the same column in which the eigenvector will be
</span><span class="comment">*</span><span class="comment"> stored.
</span><span class="comment">*</span><span class="comment"> On exit, if SIDE = 'L' or 'B', the left eigenvectors
</span><span class="comment">*</span><span class="comment"> specified by SELECT will be stored consecutively in the
</span><span class="comment">*</span><span class="comment"> columns of VL, in the same order as their eigenvalues.
</span><span class="comment">*</span><span class="comment"> If SIDE = 'R', VL is not referenced.
</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 array VL.
</span><span class="comment">*</span><span class="comment"> LDVL >= max(1,N) if SIDE = 'L' or 'B'; LDVL >= 1 otherwise.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> VR (input/output) COMPLEX*16 array, dimension (LDVR,MM)
</span><span class="comment">*</span><span class="comment"> On entry, if INITV = 'U' and SIDE = 'R' or 'B', VR must
</span><span class="comment">*</span><span class="comment"> contain starting vectors for the inverse iteration for the
</span><span class="comment">*</span><span class="comment"> right eigenvectors; the starting vector for each eigenvector
</span><span class="comment">*</span><span class="comment"> must be in the same column in which the eigenvector will be
</span><span class="comment">*</span><span class="comment"> stored.
</span><span class="comment">*</span><span class="comment"> On exit, if SIDE = 'R' or 'B', the right eigenvectors
</span><span class="comment">*</span><span class="comment"> specified by SELECT will be stored consecutively in the
</span><span class="comment">*</span><span class="comment"> columns of VR, in the same order as their eigenvalues.
</span><span class="comment">*</span><span class="comment"> If SIDE = 'L', VR is not referenced.
</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 array VR.
</span><span class="comment">*</span><span class="comment"> LDVR >= max(1,N) if SIDE = 'R' or 'B'; LDVR >= 1 otherwise.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> MM (input) INTEGER
</span><span class="comment">*</span><span class="comment"> The number of columns in the arrays VL and/or VR. MM >= M.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> M (output) INTEGER
</span><span class="comment">*</span><span class="comment"> The number of columns in the arrays VL and/or VR required to
</span><span class="comment">*</span><span class="comment"> store the eigenvectors (= the number of .TRUE. elements in
</span><span class="comment">*</span><span class="comment"> SELECT).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> WORK (workspace) COMPLEX*16 array, dimension (N*N)
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> RWORK (workspace) DOUBLE PRECISION array, dimension (N)
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> IFAILL (output) INTEGER array, dimension (MM)
</span><span class="comment">*</span><span class="comment"> If SIDE = 'L' or 'B', IFAILL(i) = j > 0 if the left
</span><span class="comment">*</span><span class="comment"> eigenvector in the i-th column of VL (corresponding to the
</span><span class="comment">*</span><span class="comment"> eigenvalue w(j)) failed to converge; IFAILL(i) = 0 if the
</span><span class="comment">*</span><span class="comment"> eigenvector converged satisfactorily.
</span><span class="comment">*</span><span class="comment"> If SIDE = 'R', IFAILL is not referenced.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> IFAILR (output) INTEGER array, dimension (MM)
</span><span class="comment">*</span><span class="comment"> If SIDE = 'R' or 'B', IFAILR(i) = j > 0 if the right
</span><span class="comment">*</span><span class="comment"> eigenvector in the i-th column of VR (corresponding to the
</span><span class="comment">*</span><span class="comment"> eigenvalue w(j)) failed to converge; IFAILR(i) = 0 if the
</span><span class="comment">*</span><span class="comment"> eigenvector converged satisfactorily.
</span><span class="comment">*</span><span class="comment"> If SIDE = 'L', IFAILR is not referenced.
</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"> > 0: if INFO = i, i is the number of eigenvectors which
</span><span class="comment">*</span><span class="comment"> failed to converge; see IFAILL and IFAILR for further
</span><span class="comment">*</span><span class="comment"> details.
</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"> Each eigenvector is normalized so that the element of largest
</span><span class="comment">*</span><span class="comment"> magnitude has magnitude 1; here the magnitude of a complex number
</span><span class="comment">*</span><span class="comment"> (x,y) is taken to be |x|+|y|.
</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> COMPLEX*16 ZERO
PARAMETER ( ZERO = ( 0.0D+0, 0.0D+0 ) )
DOUBLE PRECISION RZERO
PARAMETER ( RZERO = 0.0D+0 )
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Local Scalars ..
</span> LOGICAL BOTHV, FROMQR, LEFTV, NOINIT, RIGHTV
INTEGER I, IINFO, K, KL, KLN, KR, KS, LDWORK
DOUBLE PRECISION EPS3, HNORM, SMLNUM, ULP, UNFL
COMPLEX*16 CDUM, WK
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. External Functions ..
</span> LOGICAL <a name="LSAME.165"></a><a href="lsame.f.html#LSAME.1">LSAME</a>
DOUBLE PRECISION <a name="DLAMCH.166"></a><a href="dlamch.f.html#DLAMCH.1">DLAMCH</a>, <a name="ZLANHS.166"></a><a href="zlanhs.f.html#ZLANHS.1">ZLANHS</a>
EXTERNAL <a name="LSAME.167"></a><a href="lsame.f.html#LSAME.1">LSAME</a>, <a name="DLAMCH.167"></a><a href="dlamch.f.html#DLAMCH.1">DLAMCH</a>, <a name="ZLANHS.167"></a><a href="zlanhs.f.html#ZLANHS.1">ZLANHS</a>
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. External Subroutines ..
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?